.scanner-animation {
    position: relative;
    width: 220px;
    height: 40px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.scanner-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1 0%, #a5b4fc 100%);
    border-radius: 2px;
    animation: scan-move 1.2s linear infinite;
}
@keyframes scan-move {
    0% { top: 0; opacity: 0.7; }
    50% { top: 36px; opacity: 1; }
    100% { top: 0; opacity: 0.7; }
}

/* Flashlight button states */
.flashlight-on {
    background-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.flashlight-on:hover {
    background-color: #d97706 !important;
}

/* Camera preview enhancements */
.camera-preview {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}

/* Scanning tips fade animation */
.scanning-tips-fade {
    animation: tipsFade 4s ease-in-out;
}

@keyframes tipsFade {
    0%, 70% { opacity: 1; }
    90%, 100% { opacity: 0; }
}

/* Focus ring for tap-to-focus */
.focus-ring {
    position: absolute;
    border: 2px solid #10b981;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    pointer-events: none;
    animation: focusRing 1s ease-out;
}

@keyframes focusRing {
    0% { 
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1);
        opacity: 0;
    }
}
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

html {
    scroll-behavior: smooth;
}

.section-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8fafc;
    transition: background-color 0.3s;
}

body.mobile-menu-open {
    overflow: hidden;
}

.gradient-bg {
    background: linear-gradient(135deg, #4f46e5 0%, #10b981 100%);
}

/* Animated Hamburger Icon */
#mobileMenuBtn {
    display: none;
    width: 24px;
    height: 20px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    z-index: 50;
}

#mobileMenuBtn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white;
    border-radius: 1px;
    transition: all 0.3s ease-in-out;
}

#mobileMenuBtn.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

#mobileMenuBtn.open span:nth-child(2) {
    opacity: 0;
}

#mobileMenuBtn.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Modern Mobile Menu */
@media (max-width: 768px) {
    #mobileMenuBtn {
        display: flex; /* Only display as flex on mobile */
        flex-direction: column;
        justify-content: space-between;
    }
}
#mobileMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 40;
}

#mobileMenu.open {
    transform: translateX(0);
}

#mobileMenu nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#mobileMenu a {
    color: white;
    font-size: 1.5rem;
    font-weight: 500;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobileMenu.open a {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for menu items */
#mobileMenu.open a:nth-child(1) { transition-delay: 0.2s; }
#mobileMenu.open a:nth-child(2) { transition-delay: 0.25s; }
#mobileMenu.open a:nth-child(3) { transition-delay: 0.3s; }
#mobileMenu.open a:nth-child(4) { transition-delay: 0.35s; }
#mobileMenu.open a:nth-child(5) { transition-delay: 0.4s; }

.ingredient-card {
    transition: all 0.3s ease;
}

.ingredient-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.halal-badge { background-color: #10b981; }
.haram-badge { background-color: #ef4444; }
.mashbooh-badge { background-color: #f59e0b; }
.unknown-badge { background-color: #64748b; }

.camera-preview {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

    .scan-animation {
        position: absolute;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #10b981 0%, #4f46e5 100%);
        border-radius: 2px;
        animation: scan-move 2s linear infinite;
    }
    @keyframes scan-move {
        0% { top: 0; opacity: 0.7; }
        50% { top: calc(100% - 4px); opacity: 1; }
        100% { top: 0; opacity: 0.7; }
    }

.loading-spinner { animation: spin 1s linear infinite; }
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus states for accessibility */
button:focus, input:focus, a:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Error states */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
} 

section[id] {
    scroll-margin-top: 5rem;
} 

/* Dashboard and Modal Styles */
.tab-button { transition: all 0.3s ease; }
.tab-button:hover { color: #4f46e5; }
.tab-button.active {
    border-bottom: 2px solid #4f46e5;
    color: #4f46e5;
}
.tab-content { transition: opacity 0.3s ease; }

/* Status Badge Colors */
.status-pending { background-color: #fef3c7; color: #92400e; }
.status-solved { background-color: #d1fae5; color: #065f46; }
.status-rejected { background-color: #fee2e2; color: #991b1b; }

/* Admin Dashboard Styles */
.admin-report-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: white;
}
.admin-report-card:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Testimonial Carousel Styles */
.testimonials-carousel {
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
    padding: 20px 0;
}

.testimonials-carousel::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
}

.testimonial-card p {
    position: relative;
    padding-left: 10px;
    border-left: 3px solid #e0e7ff;
}

/* Carousel Navigation Buttons */
#testimonialPrev,
#testimonialNext {
    transition: all 0.3s ease;
    background: white !important;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#testimonialPrev:hover,
#testimonialNext:hover {
    background: #f9fafb !important;
    transform: scale(1.05);
}

#testimonialPrev:active,
#testimonialNext:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .testimonial-card {
        max-width: 95vw;
        width: 100%;
        margin: 0 auto 16px auto;
        padding: 12px;
        border-radius: 12px;
    }
    
    #testimonialPrev,
    #testimonialNext {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px;
    }
}

/* User Dashboard Styles */
.user-report-card {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: white;
}
.saved-result-card {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

/* Button Styles */
.btn-primary {
    background-color: #4f46e5;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.btn-primary:hover { background-color: #4338ca; }

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.btn-secondary:hover { background-color: #4b5563; }

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-success {
    background-color: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.btn-success:hover { background-color: #059669; }

/* Form Styles */
.form-input, .form-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease;
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Design */
@media (min-width: 769px) {
    #mobileMenuBtn {
        display: none;
    }
}

@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    .tab-button {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    .admin-report-card, .user-report-card, .saved-result-card {
        padding: 0.75rem;
    }
} 

.star-outline {
  -webkit-text-stroke: 1px #ffd500;
  text-shadow: 0 0 1px #ffd500;
}

/* === Welcome Modal (namespaced) === */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700;800;900&display=swap");

/* Overlay */
.hs-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.25);
    z-index: 60;
}

/* Container */
.hs-modal-container {
    max-height: 90vh;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.25);
    font-family: "Outfit", "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

@media (max-width: 600px) {
    .hs-modal-container { width: 90%; }
}

.hs-modal-header {
    padding: 16px 32px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hs-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    font-weight: 700;
    font-size: 1.125rem;
}

.hs-modal-title svg { width: 32px; height: 32px; color: #4f46e5; }

.hs-modal-body {
    padding: 24px 32px 51px;
    overflow-y: auto;
}

/* Rich text formatting inside the modal */
.hs-rtf h1,
.hs-rtf h2,
.hs-rtf h3,
.hs-rtf h4,
.hs-rtf h5,
.hs-rtf h6 { font-weight: 700; }

.hs-rtf h1 { font-size: 1.5rem; line-height: 1.125; }
.hs-rtf h2 { font-size: 1.25rem; line-height: 1.25; }
.hs-rtf h3 { font-size: 1rem; line-height: 1.5; }

.hs-rtf > * + * { margin-top: 1em; }
.hs-rtf > * + :is(h1, h2, h3) { margin-top: 2em; }
.hs-rtf > :is(h1, h2, h3) + * { margin-top: 0.75em; }

.hs-rtf ul,
.hs-rtf ol {
    margin-left: 20px;
    list-style-position: inside;
}
.hs-rtf ol { list-style: numeric; }
.hs-rtf ul { list-style: disc; }

.hs-modal-footer {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid #ddd;
    gap: 12px;
    position: relative;
}

.hs-modal-footer::after {
    content: "";
    display: block;
    position: absolute;
    top: -51px;
    left: 24px;
    right: 24px;
    height: 50px;
    flex-shrink: 0;
    background-image: linear-gradient(to top, rgba(255, 255, 255, 0.75), transparent);
    pointer-events: none;
}

/* Buttons */
.hs-button {
    padding: 12px 20px;
    border-radius: 8px;
    background-color: transparent;
    border: 0;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
}

.hs-button.is-ghost:hover,
.hs-button.is-ghost:focus { background-color: #dfdad7; }

.hs-button.is-primary { background-color: #4f46e5; color: #fff; }
.hs-button.is-primary:hover,
.hs-button.is-primary:focus { background-color: #4338ca; }

/* Icon button */
.hs-icon-button {
    padding: 0;
    border: 0;
    background-color: transparent;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.15s ease;
}

.hs-icon-button svg { width: 24px; height: 24px; }
.hs-icon-button:hover,
.hs-icon-button:focus { background-color: #dfdad7; }

/* Scrollbar styling for modal body only */
.hs-modal-body { scrollbar-width: thin; }
.hs-modal-body::-webkit-scrollbar { background-color: transparent; width: 12px; }
.hs-modal-body::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background-color: #ddd;
    border: 4px solid #fff;
}

/* === Testimonials (mobile tuning) === */

.testimonial-card {
    max-width: 350px;
    width: 100%;
    margin: 0 auto 16px auto;
    padding: 16px;
    border-radius: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Removed hover effect */
}

.avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 700;
}

.avatar-initials {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.testimonial-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}
.testimonial-role {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 4px;
}
.testimonial-stars {
    color: #fbbf24;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.testimonial-text {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
    margin-top: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
}

.testimonial-text {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* show up to 3 lines on mobile */
    -webkit-box-orient: vertical;
    line-clamp: 3; /* standard property for compatibility */
}

@media (max-width: 640px) {
    #testimonialsCarousel {
        gap: 8px;
        padding: 0 4px;
    }
    .testimonial-card {
        max-width: 95vw;
        padding: 10px;
        border-radius: 10px;
        /* No hover effect on mobile */
    }
    .avatar-sm {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .testimonial-name {
        font-size: 0.98rem;
    }
    .testimonial-role {
        font-size: 0.8rem;
    }
    .testimonial-text {
        font-size: 0.92rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
}