/*
 * Pro-21 Diet Tracker - Mobile First CSS Framework
 */

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

body {
  line-height: 1.5;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #333;
  background-color: #f8fafc;
}

/* Flexbox Layout System */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

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

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.flex-1 {
  flex: 1;
}

.flex-none {
  flex: none;
}

/* Mobile First Container */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }

/* Colors */
.bg-white { background-color: white; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-gray-100 { background-color: #f3f4f6; }

.text-green-700 { color: #15803d; }
.text-red-700 { color: #b91c1c; }
.text-gray-600 { color: #4b5563; }
.text-gray-800 { color: #1f2937; }

/* Typography */
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Borders */
.border { border: 1px solid #e5e7eb; }
.border-2 { border: 2px solid #e5e7eb; }
.border-green-200 { border-color: #bbf7d0; }
.border-red-200 { border-color: #fecaca; }
.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }

/* Shadows */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

/* Width and Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Display */
.block { display: block; }
.hidden { display: none; }

/* Spacing utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* Additional spacing */
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }

/* Additional colors */
.bg-gray-50 { background-color: #f9fafb; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-purple-600 { color: #9333ea; }
.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #059669; }
.text-red-600 { color: #dc2626; }
.text-yellow-600 { color: #d97706; }
.text-purple-600 { color: #9333ea; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-green-800 { color: #166534; }
.text-red-800 { color: #991b1b; }

.border-yellow-200 { border-color: #fde68a; }
.border-blue-200 { border-color: #bfdbfe; }

.bg-blue-100 { background-color: #dbeafe; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Transitions */
.transition-colors { 
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Text decoration utilities */
.no-underline { text-decoration: none; }
.underline { text-decoration: underline; }

/* Cursor utilities */
.cursor-pointer { cursor: pointer; }

/* Transform utilities */
.scale-110 { transform: scale(1.1); }
.hover\\:scale-110:hover { transform: scale(1.1); }

/* Transition utilities */
.transition-all { 
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.duration-200 {
  transition-duration: 200ms;
}

/* Additional colors for navigation */
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }

.hover\\:text-gray-600:hover { color: #4b5563; }
.hover\\:bg-gray-50:hover { background-color: #f9fafb; }

/* Hover states */
.hover\\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\\:text-gray-800:hover { color: #1f2937; }

/* Form Styles */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox and Radio Styles */
input[type="checkbox"],
input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: #059669;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background-color: #059669;
  color: white;
}

.btn-primary:hover {
  background-color: #047857;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-outline {
  background-color: transparent;
  color: #059669;
  border: 1px solid #059669;
}

.btn-outline:hover {
  background-color: #059669;
  color: white;
}

.btn-full {
  width: 100%;
}

/* Card Component */
.card {
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid #f3f4f6;
}

/* Mobile touch targets */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Additional responsive text sizes */
.text-xs { font-size: 0.75rem; }

/* Leading/line-height utilities */
.leading-tight { line-height: 1.25; }

/* Additional spacing utilities */
.mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; }
.mx-6 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }

/* Additional flexbox utilities */
.justify-end { justify-content: flex-end; }

/* Diet-specific styles */
.diet-encourage {
  background-color: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
}

.diet-avoid {
  background-color: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* Progressive login styles handled by .hidden class in HTML */

/* Responsive Grid */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 2rem;
  }
  
  .sm\\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .sm\\:flex-row {
    flex-direction: row;
  }
  
  .sm\\:text-left {
    text-align: left;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
  
  .md\\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
  
  .lg\\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
