/* Sound Inventory Tracker - Mobile-First Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --success: #059669;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f3f4f6;
  --text: #1f2937;
  --border: #d1d5db;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}

/* Layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px; /* Space for fixed nav */
}

.container {
  padding: 1rem;
  max-width: 100%;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

h1, h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

/* Navigation */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0;
  height: 70px;
  z-index: 200;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.75rem;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.nav-item i, .nav-item svg {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* Buttons */
button, .btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Dropdown & Select */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231f2937' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Cards & Lists */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.list-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-content {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.list-item-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
}

.list-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* Checkboxes */
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.checkbox:hover {
  background: var(--bg);
}

/* Alert */
.alert {
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: #ecfdf5;
  border-color: var(--success);
  color: #065f46;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--danger);
  color: #7f1d1d;
}

.alert-warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: #eff6ff;
  border-color: var(--primary);
  color: #1e3a8a;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Loading & States */
.loading {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (min-width: 768px) {
  .container {
    padding: 2rem;
    margin: 0 auto;
    max-width: 1200px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
  }

  nav {
    position: static;
    height: auto;
    flex-direction: column;
    border-top: none;
    border-left: 1px solid var(--border);
    width: 200px;
    min-height: 100vh;
  }

  .nav-item {
    justify-content: flex-start;
    padding: 1rem;
    font-size: 0.95rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-small {
  font-size: 0.875rem;
}

.text-muted {
  color: #6b7280;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

.flex {
  display: flex;
  gap: 0.5rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
