/* ========================================
   MODERN CSS FOR HOUSEHOLD INVENTORY APP
   ======================================== */

/* CSS Variables for easy theming */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  --glow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--bg-main) 0%, #1a1f3a 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.container h2 {
    margin-bottom: 1rem;
}

/* Header / Navigation */
header {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.5rem 2rem;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
}

nav a:hover {
  color: var(--text-primary);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 80%;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Glass Card Effect */
.card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-block;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  display: table;
}

/* Mobile Cards - hidden on desktop */
.mobile-card {
  display: none;
}

thead {
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 2px solid var(--primary);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

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

.badge-low {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-high {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Stats Cards */
.stat-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.5rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  word-wrap: break-word;
}

.alert-info {
  background: rgba(99, 102, 241, 0.1);
  border-left: 4px solid var(--primary);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  color: var(--text-primary);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  color: var(--text-primary);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  /* Hamburger Menu Mobile */
  .hamburger {
    display: flex;
  }
  
  nav {
    flex-wrap: wrap;
  }
  
  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 1rem;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
  }
  
  nav ul.active {
    display: flex;
  }
  
  nav ul li {
    width: 100%;
  }
  
  nav a {
    display: block;
    padding: 0.75rem;
  }
  
  nav a::after {
    display: none;
  }
  
  /* Mobile Table as Cards */
  table {
    display: none;
  }
  
  .mobile-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  
  .mobile-card-row:last-of-type {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
  }
  
  .mobile-card-value {
    text-align: right;
  }
  
  .mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }
  
  .mobile-card-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-card-actions form {
    flex: 1;
    display: flex;
  }
  
  .mobile-card-actions form .btn {
    width: 100%;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
footer {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 4rem;
  text-align: center;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-team {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-badge:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.footer-heart {
  color: var(--secondary);
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Form Container */
.form-container {
  max-width: 500px !important;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem;
}

.form-container .card {
  width: 100%;
  max-width: 100%;
}

/* Category Links with Colors */
.category-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid;
}

/* Category Color Variants */
.cat-blue {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}
.cat-blue:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
}

.cat-green {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}
.cat-green:hover {
  background: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
}

.cat-purple {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.4);
}
.cat-purple:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #e9d5ff;
}

.cat-orange {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
  border-color: rgba(249, 115, 22, 0.4);
}
.cat-orange:hover {
  background: rgba(249, 115, 22, 0.3);
  color: #fed7aa;
}

.cat-pink {
  background: rgba(236, 72, 153, 0.2);
  color: #f9a8d4;
  border-color: rgba(236, 72, 153, 0.4);
}
.cat-pink:hover {
  background: rgba(236, 72, 153, 0.3);
  color: #fbcfe8;
}

.cat-cyan {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.4);
}
.cat-cyan:hover {
  background: rgba(6, 182, 212, 0.3);
  color: #a5f3fc;
}

.cat-red {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
.cat-red:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.cat-yellow {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.4);
}
.cat-yellow:hover {
  background: rgba(234, 179, 8, 0.3);
  color: #fef08a;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid;
}

.category-badge:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

/* Action Buttons in Table */
td .btn {
  min-width: 90px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}

td form {
  margin: 0;
  display: inline-block;
}

td .action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 2rem; }