@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

    
:root {
  --primary: #FFB703;          /* أصفر مشمس */
  --primary-dark: #FB8500;     /* برتقالي دافئ */
  --primary-light: #FFF8E1;    /* خلفية كريمية */
  --secondary: #8ECAE6;        /* أزرق سماوي */
  --light: #FFF8E1;            /* خلفية فاتحة عامة */
  --dark: #2B2D42;             /* رمادي غامق للقراءة */
  --success: #4CAF50;          /* أخضر صحي */
  --info: #219EBC;             /* أزرق متوسط */
  --warning: #FB8500;          /* برتقالي دافئ */
  --danger: #EF476F;           /* وردي محبب للأطفال */
  --gray-100: #FFF8E1;
  --gray-200: #FCECCB;
  --gray-300: #F5D98D;
  --gray-600: #4A4A4A;
  --gray-800: #2B2D42;
  --radius: 12px;
  --shadow: 0 10px 25px rgba(251, 133, 0, 0.15);
  --card-shadow: 0 8px 20px rgba(255, 183, 3, 0.12);
  --gradient: linear-gradient(135deg, #FFB703, #FB8500);
}


        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Tajawal', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

body {
  background: 
    linear-gradient(rgba(255, 245, 210, 0.6), rgba(255, 245, 210, 0.6)), /* شفافية أقل عشان الألوان تبان */
    url('background_fruits.jpg');
  background-repeat: repeat;
  background-size: 600px; /* زوّد الحجم = زووم أكتر */
  background-attachment: fixed;
  background-position: center;
}


/* تغليف المكونات على الخلفية */
.card,
.upload-area,
.features-section,
.faq-section,
.how-it-works {
  background-color: #FFF8E6; /* كريمي ناعم بدل الأبيض */
  backdrop-filter: blur(4px);
  border-radius: 24px;
  box-shadow: 0 6px 18px rgba(255, 180, 50, 0.15);
  border: 1px solid rgba(255, 200, 100, 0.2);
}

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 1rem 1rem;
        }

        header {
            text-align: center;
            margin-bottom: 3rem;
        }

        h1 {
            color: var(--dark);
            background: var(--gradient);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 0.5rem;
            font-weight: 800;
            font-size: 2.25rem;
        }

        .subtitle {
            color: var(--gray-600);
            font-size: 1.2rem;
            max-width: 600px;
            margin: 0 auto;
        }

        .main-content {
            display: grid;
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        @media (min-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
                margin: 0 auto;
            }
        }

        .card {
            background-color: white;
            border-radius: var(--radius);
            padding: 2rem;
            box-shadow: var(--card-shadow);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

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

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

        .upload-area {
            border: 2px dashed var(--gray-300);
            border-radius: var(--radius);
            padding: 2rem;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 1.5rem;
            position: relative;
            height: 350px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .upload-default-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            transition: opacity 0.3s ease;
        }

        .upload-preview {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: none;
            align-items: center;
            justify-content: center;
            background-color: rgba(255, 255, 255, 0.9);
        }

        .upload-preview.show {
            display: flex;
        }

        .close-preview {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 30px;
            height: 30px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 12px;
            z-index: 10;
            transition: all 0.2s ease;
        }

        .close-preview:hover {
            background-color: rgba(0, 0, 0, 0.8);
            transform: scale(1.1);
        }

        .upload-buttons {
            display: flex;
            gap: 1rem;
            margin-top: 1rem;
        }

        .upload-area:hover {
            border-color: var(--primary);
            background-color: rgba(58, 134, 255, 0.05);
        }

        .upload-area.active {
            border-color: var(--primary);
            background-color: rgba(58, 134, 255, 0.1);
        }

        .upload-icon {
            font-size: 3.5rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .upload-text {
            margin-bottom: 1.5rem;
            color: var(--gray-600);
            font-size: 1.1rem;
        }

.btn {
  background: linear-gradient(135deg, #FFB703, #FFD166);
  color: #fff;
  border: none;
  padding: 0.95rem 2.2rem;
  border-radius: 45px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  box-shadow: 0 5px 14px rgba(255, 179, 3, 0.4);
}

.btn-icon {
  font-size: 1.3rem;
  font-style: normal;
}

.btn-download {
  background: linear-gradient(135deg, #4CAF50, #81C784);
  box-shadow: 0 5px 12px rgba(76, 175, 80, 0.3);
}

.btn-download:hover {
  background: linear-gradient(135deg, #43A047, #A5D6A7);
  box-shadow: 0 7px 18px rgba(56, 142, 60, 0.35);
}

.analyze-btn {
  min-width: 160px;
  background: linear-gradient(135deg, #FB8500, #FFB703);
  box-shadow: 0 6px 15px rgba(251, 133, 0, 0.3);
}

.btn-loader {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  right: 18px;
}

.btn-loader.show {
  display: block;
}

.btn-secondary {
  background: linear-gradient(135deg, #90CAF9, #BBDEFB);
  color: #1E3A8A;
  border: none;
  box-shadow: 0 4px 10px rgba(33, 150, 243, 0.25);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #64B5F6, #E3F2FD);
  transform: translateY(-2px);
}

.btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #FFA500, #FFCA3A);
  box-shadow: 0 7px 20px rgba(255, 165, 0, 0.45);
}
.btn:active {
  transform: scale(0.97);
}
        .btn:disabled {
            background: linear-gradient(135deg, #9E9E9E, #BDBDBD);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 4px 10px rgba(158, 158, 158, 0.2);
        }

        .image-preview {
            max-width: 90%;
            max-height: 90%;
            border-radius: var(--radius);
            object-fit: contain;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

.button-group {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 1.8rem;
}

        .results-container {
            height: 100%;
            display: none;
        }

        .results-container.show {
            display: block;
        }

        .results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            border-bottom: 2px solid var(--primary-light);
            padding-bottom: 0.75rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .results-actions {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .result-title {
            color: var(--dark);
            font-weight: 700;
            font-size: 1.6rem;
            margin: 0;
        }

        /* Food header with image */
        .food-header {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 2rem;
            align-items: center;
        }

        .food-image-container {
            width: 120px;
            height: 120px;
            overflow: hidden;
            border-radius: var(--radius);
            flex-shrink: 0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border: 3px solid white;
            outline: 1px solid var(--gray-200);
        }

        .food-result-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .food-info {
            flex: 1;
        }

        .nutrition-table {
            width: 100%;
            border-collapse: collapse;
            margin: 2rem 0;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

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

        .nutrition-table td {
            padding: 1rem;
            border-bottom: 1px solid var(--gray-200);
        }

        .nutrition-table tr:last-child td {
            border-bottom: none;
        }

        .nutrition-table tr:nth-child(even) {
            background-color: var(--primary-light);
        }

        .food-name {
            font-size: 1.6rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--dark);
        }

        .food-description {
            color: var(--gray-600);
            font-size: 1.05rem;
            margin-bottom: 1rem;
        }

        .macro-chart {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin: 1.5rem 0;
            background: white;
            padding: 1.5rem;
            border-radius: var(--radius);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .macro-item {
            text-align: center;
            background: var(--primary-light);
            padding: 1rem;
            border-radius: var(--radius);
            transition: transform 0.3s ease;
        }

        .macro-item:hover {
            transform: translateY(-5px);
        }

        .macro-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .macro-label {
            font-size: 0.9rem;
            color: var(--gray-600);
            font-weight: 500;
        }

        .health-tag {
            display: inline-block;
            background: var(--primary-light);
            color: var(--primary);
            padding: 0.4rem 1rem;
            border-radius: 20px;
            font-size: 0.85rem;
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
            font-weight: 600;
            transition: all 0.3s ease;
            border: 1px solid rgba(0, 119, 255, 0.2);
        }

        .health-tag:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-2px);
        }

        .health-tags {
            margin: 1.5rem 0;
        }

        /* Recipe section styles */
        .recipe-section {
            margin-top: 2rem;
            padding: 1.5rem;
            background: var(--primary-light);
            border-radius: var(--radius);
            border-left: 4px solid var(--primary);
        }

        .recipe-title {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .recipe-text {
            font-size: 1rem;
            line-height: 1.7;
            color: var(--gray-800);
            white-space: pre-line;
        }

        /* Reset button styles */
        .reset-btn {
            background-color: white;
            color: var(--gray-600);
            border: 1px solid var(--gray-300);
            padding: 0.85rem 2rem;
            border-radius: 30px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .reset-btn:hover {
            background-color: var(--gray-100);
            color: var(--gray-800);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* Loading spinner */
        .loader {
            display: none;
            width: 40px;
            height: 40px;
            border: 4px solid var(--primary-light);
            border-top: 4px solid var(--primary);
            border-radius: 50%;
            margin: 2rem auto;
            animation: spin 1s linear infinite;
        }

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

        .error-message {
            color: var(--danger);
            margin-top: 1rem;
            display: none;
            padding: 0.75rem;
            background-color: rgba(239, 68, 68, 0.1);
            border-radius: var(--radius);
            font-weight: 500;
        }

        /* File input styling */
        input[type="file"] {
            display: none;
        }

        footer {
            text-align: center;
            margin-top: 3rem;
            color: var(--gray-600);
            padding: 1.5rem 0;
            border-top: 1px solid var(--gray-200);
        }

        /* Features section */
        .features-section {
            margin: 4rem 0;
            text-align: center;
        }

        .features-title {
            font-size: 2rem;
            font-weight: 700;
            color: var(--gray-800);
            margin-bottom: 2rem;
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
        }

        .feature-card {
            background-color: white;
            padding: 2rem;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            transition: transform 0.3s ease;
        }

        .feature-card:hover {
            transform: translateY(-5px);
        }

        .feature-icon {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .feature-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            color: var(--gray-800);
        }

        .feature-desc {
            color: var(--gray-600);
            font-size: 0.95rem;
        }

        /* How it works section */
        .how-it-works {
            margin: 4rem 0;
        }

        .how-title {
            font-size: 2rem;
            font-weight: 700;
            color: var(--gray-800);
            margin-bottom: 2rem;
            text-align: center;
        }

        .steps {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        @media (min-width: 768px) {
            .steps {
                flex-direction: row;
            }
        }

        .step {
            flex: 1;
            position: relative;
            padding: 1.5rem;
            background-color: white;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }

        .step-number {
            position: absolute;
            top: -15px;
            left: -15px;
            background-color: var(--primary);
            color: white;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
        }

        .step-title {
            margin-bottom: 1rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .step-desc {
            color: var(--gray-600);
            font-size: 0.95rem;
        }

        /* FAQ Section */
        .faq-section {
            margin: 4rem 0;
        }

        .faq-title {
            font-size: 2rem;
            font-weight: 700;
            color: var(--gray-800);
            margin-bottom: 2rem;
            text-align: center;
        }

        .faq-item {
            background-color: white;
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-bottom: 1rem;
            box-shadow: var(--shadow);
        }

        .faq-question {
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.75rem;
            font-size: 1.1rem;
        }

        .faq-answer {
            color: var(--gray-600);
        }

        /* Site Header */
        .site-header {
            background: var(--gradient);
            color: white;
            padding: 1rem 0;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

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

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

        .logo-icon {
            font-size: 1.8rem;
        }

        .logo-text {
            font-weight: 800;
            font-size: 1.5rem;
            letter-spacing: -0.5px;
        }

        .header-tagline {
            font-size: 1rem;
            font-weight: 500;
            opacity: 0.9;
        }

        @media (max-width: 480px) {
            .header-tagline {
                display: none;
            }
        }
        
        /* Responsive styles */
        @media (max-width: 768px) {
            h1 {
                font-size: 1rem;
            }
            
            .subtitle {
                font-size: 1rem;
            }
            
            .main-content {
                gap: 1.5rem;
            }
            
            .card {
                padding: 1.5rem;
            }
            
            .upload-area {
                height: 300px;
                padding: 1rem;
            }
            
            .btn {
                padding: 0.75rem 1.5rem;
                font-size: 0.95rem;
            }
            
            .food-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            
            .food-image-container {
                margin-bottom: 1rem;
            }
            
            .macro-chart {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
            }
            
            .results-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            
            .results-actions {
                margin-top: 1rem;
                justify-content: center;
            }
        }
        
        @media (max-width: 480px) {
            .upload-buttons {
                flex-direction: column;
                gap: 0.75rem;
            }
            
            .btn {
                width: 100%;
            }
            
            .result-title {
                font-size: 1.4rem;
            }
            
            .food-name {
                font-size: 1.4rem;
            }
            
            .nutrition-table th,
            .nutrition-table td {
                padding: 0.75rem;
            }
        }

        .analyze-btn span {
            margin-right: 0;
        }

        /* Show margin only when loader is active */
        .btn-loader.show {
            display: block;
        }

        .btn-loader.show ~ span {
            margin-right: 30px;
        }
        .lang-switch {
          display: flex;
          align-items: center;
          gap: .5rem;
          padding: .4rem .9rem;
          border: none;
          border-radius: 20px;
          background: #ffffff;
          cursor: pointer;
          font-weight: 600;
          font-size: 0.9rem;
          transition: background 0.2s;
        }
        .lang-switch:hover {
          background: #f0f0f0;
        }
        .lang-ico {
          font-size: 1.2rem;
          line-height: 1;
        }
        .lang-next {
          font-family: inherit;
        }
        /* Better emoji rendering + alignment */
        .lang-ico{
          font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Noto Emoji", emoji, sans-serif;
          display: inline-block;
          width: 1.35rem;           /* keeps icon width fixed */
          text-align: center;
          font-size: 1.2rem;
          line-height: 1;
        }
        .lang-next{
          line-height: 1;
          white-space: nowrap;
          font-weight: 600;
          letter-spacing: .3px;
        }
        
        /* Keep icon-left then label even in RTL layouts */
        .lang-switch{ display:flex; flex-direction: row; align-items:center; gap:.5rem; }

/* Use Harmattan for Arabic text only */
html[lang="ar"] body,
html[lang="ar"] * {
  font-family: 'Harmattan', 'Tajawal', 'Segoe UI', sans-serif !important;
  letter-spacing: 0;
}
.school-footer {
  background: rgba(255, 245, 210, 0.4); /* خلفية شبه شفافة */
  border-top: 1px solid rgba(250, 200, 80, 0.3);
  padding: 2rem 1rem;
  text-align: center;
  color: #2B2D42;
  box-shadow: none;
}
.school-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, rgba(255, 245, 210, 0.6), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.footer-content {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.school-logo {
  width: 100px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.05));
  flex-shrink: 0;
}

/* موبايل */
@media (max-width: 600px) {
  .school-logo {
    width: 45%;
    max-width: 150px;
    max-height: 60px;
    height: auto;
    margin-bottom: 0.5rem;
  }
}


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

.footer-text h3 {
  margin: 0;
  font-weight: 700;
  color: #2B2D42;
  font-size: 1.2rem;
  line-height: 1.4;
}

.footer-text p {
  margin: 0.2rem 0;
  color: #4b5563;
  font-size: 1rem;
}

.footer-text small {
  display: block;
  margin-top: 0.4rem;
  color: #666;
  font-size: 0.85rem;
}

/* موبايل */
@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.6rem;
  }

  .school-logo {
    width: 70px;
    max-height: 55px;
    margin-bottom: 0.4rem;
  }

  .footer-text h3 {
    font-size: 1rem;
  }

  .footer-text p {
    font-size: 0.85rem;
  }

  .footer-text small {
    font-size: 0.75rem;
  }
}
/* ===== Header with school logo ===== */
.site-header {
  background: linear-gradient(135deg, #FFF9E6, #FFD8A8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

/* School logo */
.school-logo-container {
  display: flex;
  align-items: center;
}
.header-school-logo {
  height: 55px;
  width: auto;
  border-radius: 10px;
  object-fit: contain;
  background-color: white;
  padding: 3px 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.header-school-logo:hover {
  transform: scale(1.05);
}

/* App logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.logo-icon {
  font-size: 1.8rem;
}
.logo-text {
  font-weight: 700;
  font-size: 1.4rem;
  color: #1E3A8A;
}

/* Tagline */
.header-tagline {
  text-align: center;
  font-size: 1rem;
  color: #2563EB;
  margin-top: 0.4rem;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .header-school-logo {
    height: 40px;
  }
  .logo-text {
    font-size: 1.1rem;
  }
  .header-tagline {
    font-size: 0.9rem;
  }
}

