/* NomNom - Fresh & Modern Food Management UI */

:root {
  /* Fresh Fruit Color Palette */
  --primary: #ff6b6b; /* Tomato Red */
  --secondary: #4ecdc4; /* Mint Green */
  --accent: #ffe66d; /* Banana Yellow */
  --success: #95e1d3; /* Lime Green */
  --warning: #ffa07a; /* Orange */
  --danger: #e63946; /* Cherry Red */

  /* Neutral Colors */
  --bg-cream: #fffef9; /* Cream background */
  --bg-light: #f7fff7; /* Light mint background */
  --text-dark: #2c3e50; /* Dark text */
  --text-muted: #7f8c8d; /* Muted text */
  --border: #e8f5e9; /* Light border */

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light) 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation Bar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--accent);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand:hover {
  color: var(--secondary);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.navbar-menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.navbar-link {
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
  font-weight: 500;
}

.navbar-link:hover {
  background: var(--accent);
  color: var(--text-dark);
  transform: translateY(-2px);
}

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

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Headings */
h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
  color: var(--secondary);
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #ff8e8e 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff8e8e 0%, var(--primary) 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, #6eded6 100%);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #b0f0e4 100%);
  color: var(--text-dark);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #ffb89c 100%);
  color: white;
}

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

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

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

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

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: linear-gradient(135deg, var(--accent) 0%, #ffed8f 100%);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border);
}

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

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Purchased items style */
.purchased-row {
  opacity: 0.6;
  text-decoration: line-through;
}

/* Feature Cards for Homepage */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

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

.feature-title {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Alert Messages */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: #d4edda;
  border-color: var(--success);
  color: #155724;
}

.alert-error {
  background: #f8d7da;
  border-color: var(--danger);
  color: #721c24;
}

.alert-warning {
  background: #fff3cd;
  border-color: var(--warning);
  color: #856404;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

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

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-container {
    flex-direction: column;
    gap: 1rem;
  }

  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Error Messages */
.field_with_errors input {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1) !important;
}

.field_with_errors label {
  color: var(--danger);
}

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.p-1 {
  padding: 0.5rem;
}
.p-2 {
  padding: 1rem;
}
.p-3 {
  padding: 1.5rem;
}
