/**
 * Inventar-Management Styles - MIT TABELLEN-ÜBERSICHT
 */

/* === HEADER === */
.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
}

.mp-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}

/* === STATS GRID === */
.mp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.mp-stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s;
}

.mp-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.mp-stat-card:nth-child(2) {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.mp-stat-card:nth-child(3) {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.mp-stat-card:nth-child(4) {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.mp-stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.mp-stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.mp-stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* === ACTION GRID === */
.mp-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.mp-action-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.mp-action-card:hover {
  border-color: #2196F3;
  box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
  transform: translateY(-4px);
}

.mp-action-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.mp-action-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.mp-action-desc {
  font-size: 0.9rem;
  color: #666;
}

/* === CARD === */
.mp-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mp-card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #333;
}

/* === SEARCH CARD === */
.mp-search-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.mp-search-card input {
  font-size: 1.1rem;
  padding: 1rem;
}

/* === TABLE CARD === */
.mp-table-card {
  padding: 0;
  overflow-x: auto;
}

/* === ITEMS TABLE === */
.mp-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.mp-items-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mp-items-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.mp-items-table th:hover {
  background: rgba(255,255,255,0.1);
}

.mp-items-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}

.mp-items-table tbody tr:hover {
  background: #f9fafb;
}

.mp-items-table td {
  padding: 1rem;
  vertical-align: top;
}

.mp-qr-cell {
  font-family: monospace;
  font-weight: bold;
  color: #2196F3;
  white-space: nowrap;
}

.mp-main-cell {
  font-weight: 600;
  color: #333;
}

.mp-number-cell {
  text-align: right;
  font-family: monospace;
  white-space: nowrap;
}

/* === SCAN CARD === */
.mp-scan-card {
  max-width: 600px;
  margin: 0 auto;
}

.mp-scan-input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mp-scan-input-group .mp-input-large {
  flex: 1;
}

/* === INPUT LARGE (SCANNER) === */
.mp-input-large {
  font-size: 2rem !important;
  padding: 1.5rem !important;
  text-align: center;
  font-family: monospace;
  font-weight: bold;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
}

.mp-input-large:focus {
  border-color: #2196F3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* === BUTTONS === */
.mp-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

.mp-btn-cta {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white !important;
}

.mp-btn-cta:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.mp-btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
}

/* === STATUS BUTTONS (OK / BESCHÄDIGT) === */
.mp-status-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.mp-btn-status {
  padding: 2rem 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  border: 3px solid;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.mp-btn-status-ok {
  border-color: #4CAF50;
  color: #4CAF50;
}

.mp-btn-status-ok:hover {
  background: #4CAF50;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.mp-btn-status-damaged {
  border-color: #ff9800;
  color: #ff9800;
}

.mp-btn-status-damaged:hover {
  background: #ff9800;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
}

/* === ITEM DISPLAY === */
.mp-item-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.mp-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.mp-item-qr {
  font-family: monospace;
  font-weight: bold;
}

.mp-item-category {
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.mp-item-name {
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

.mp-item-detail {
  margin: 0.5rem 0;
  opacity: 0.95;
}

/* === DAMAGE FORM === */
.mp-damage-form {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #fff3cd;
  border-radius: 12px;
  border: 2px solid #ff9800;
}

.mp-damage-form h4 {
  margin-top: 0;
  color: #e65100;
}

/* === FORM === */
.mp-form {
  max-width: 600px;
}

.mp-form-row {
  margin-bottom: 1.5rem;
}

.mp-form-row label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #555;
}

.mp-input,
.mp-input textarea,
.mp-input select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.mp-input:focus,
.mp-input textarea:focus,
.mp-input select:focus {
  border-color: #2196F3;
  outline: none;
}

textarea.mp-input {
  resize: vertical;
  min-height: 100px;
}

/* === BUTTON GROUP === */
.mp-button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.mp-button-group .mp-btn {
  flex: 1;
}

/* === ALERTS === */
.mp-alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.mp-alert-info {
  background: #e3f2fd;
  border-color: #2196F3;
  color: #0d47a1;
}

.mp-alert-success {
  background: #e8f5e9;
  border-color: #4CAF50;
  color: #1b5e20;
}

.mp-alert-warning {
  background: #fff3e0;
  border-color: #ff9800;
  color: #e65100;
}

.mp-alert-error {
  background: #ffebee;
  border-color: #f44336;
  color: #b71c1c;
}

/* === BADGES === */
.mp-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e0e0e0;
  color: #333;
}

.mp-badge-success {
  background: #4CAF50;
  color: white;
}

.mp-badge-warning {
  background: #ff9800;
  color: white;
}

.mp-badge-error {
  background: #f44336;
  color: white;
}

/* === LOADING === */
.mp-loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: #666;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .mp-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .mp-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .mp-actions-grid {
    grid-template-columns: 1fr;
  }
  
  .mp-status-buttons {
    grid-template-columns: 1fr;
  }
  
  .mp-scan-input-group {
    flex-direction: column;
  }
  
  .mp-button-group {
    flex-direction: column;
  }
  
  .mp-item-name {
    font-size: 1.4rem;
  }
  
  .mp-btn-status {
    font-size: 1.2rem;
    padding: 1.5rem 1rem;
  }
  
  .mp-items-table {
    font-size: 0.85rem;
  }
  
  .mp-items-table th,
  .mp-items-table td {
    padding: 0.75rem 0.5rem;
  }
  
  /* Horizontales Scrollen für Tabelle auf mobil */
  .mp-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* === TABELLEN-SCROLL-SCHATTEN === */
.mp-table-card {
  background:
    /* Schatten oben */
    linear-gradient(white 30%, rgba(255,255,255,0)),
    /* Schatten unten */  
    linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
    /* Schatten links */
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
    /* Schatten rechts */
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 100% 40px, 100% 40px, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* === ACTIONS COLUMN === */
.mp-actions-col {
  width: 100px;
  text-align: center;
}

/* === ICON BUTTONS === */
.mp-btn-icon {
  display: inline-block;
  padding: 0.5rem;
  margin: 0 0.25rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mp-btn-icon:hover {
  transform: scale(1.1);
}

.mp-btn-edit {
  border-color: #2196F3;
}

.mp-btn-edit:hover {
  background: #2196F3;
  filter: grayscale(100%) brightness(2);
}

.mp-btn-delete {
  border-color: #f44336;
}

.mp-btn-delete:hover {
  background: #f44336;
  filter: grayscale(100%) brightness(2);
}

/* === DANGER BUTTON === */
.mp-btn-danger {
  background: #f44336;
  color: white !important;
}

.mp-btn-danger:hover {
  background: #d32f2f;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* === EDIT INFO CARD === */
.mp-edit-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mp-edit-qr {
  font-size: 1.5rem;
  font-family: monospace;
  font-weight: bold;
}

.mp-edit-id {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* === WIDE FORM === */
.mp-form-wide {
  max-width: 800px;
}

/* === RESPONSIVE UPDATES === */
@media (max-width: 768px) {
  .mp-actions-col {
    width: auto;
  }
  
  .mp-btn-icon {
    padding: 0.4rem;
    margin: 0 0.15rem;
    font-size: 1rem;
  }
  
  .mp-edit-info {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .mp-edit-qr {
    font-size: 1.2rem;
  }
}

/* === QR-SCANNER STYLES === */

.mp-scanner-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.mp-scanner-toggle .mp-btn {
  flex: 1;
  max-width: 200px;
}

.mp-camera-container {
  margin: 1.5rem 0;
}

#qr-reader,
#new-qr-reader {
  max-width: 600px;
  margin: 0 auto;
  border: 3px solid #2196F3;
  border-radius: 12px;
  overflow: hidden;
}

#qr-reader video,
#new-qr-reader video {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.mp-camera-hint {
  text-align: center;
  color: #666;
  margin-top: 1rem;
  font-size: 1.1rem;
}

.mp-manual-container {
  margin: 1.5rem 0;
}

/* === RESPONSIVE SCANNER === */
@media (max-width: 768px) {
  #qr-reader,
  #new-qr-reader {
    max-width: 100%;
  }
  
  .mp-scanner-toggle {
    flex-direction: column;
  }
  
  .mp-scanner-toggle .mp-btn {
    max-width: 100%;
  }
}
