/* ===================================================
   OTTOMIE - Components Stylesheet
   Reusable UI Components
   =================================================== */

/* ===== Preloader ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-preloader);
    transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

.preloader-spinner {
    width: 140px;
    height: 140px;
    position: relative;
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-spinner::before,
.preloader-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 4px solid transparent;
}

.preloader-spinner::before {
    width: 100%;
    height: 100%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.preloader-spinner::after {
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    border-top-color: var(--secondary);
    animation: spin 0.7s linear infinite reverse;
}

.preloader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: auto;
    animation: pulse 1s ease-in-out infinite;
}

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

.preloader-text {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--primary);
    letter-spacing: 6px;
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5); }
    50% { text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.8), 0 0 60px rgba(var(--primary-rgb), 0.4); }
}

.preloader-progress {
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    margin-top: var(--spacing-xl);
    overflow: hidden;
}

.preloader-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    animation: loading 2s ease-out forwards;
}

@keyframes loading {
    to { width: 100%; }
}

/* ===== Header / Navbar ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 var(--spacing-2xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-fixed);
    transition: all var(--transition-base);
}

.header.scrolled {
    height: var(--header-height-scrolled);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

/* Dark background pages - header with light text */
.header-dark .nav-link {
    color: var(--light);
}

.header-dark .nav-link:hover,
.header-dark .nav-link.active {
    color: var(--primary);
}

.header-dark .header-logo {
    color: var(--light);
}

.header-dark .menu-toggle span {
    background: var(--light);
}

/* When scrolled, revert to normal colors */
.header-dark.scrolled .nav-link {
    color: var(--dark);
}

.header-dark.scrolled .nav-link:hover,
.header-dark.scrolled .nav-link.active {
    color: var(--primary);
}

.header-dark.scrolled .header-logo {
    color: var(--primary);
}

.header-dark.scrolled .menu-toggle span {
    background: var(--dark);
}

/* Orange/Primary background pages - header with light text, different active color */
.header-orange .nav-link {
    color: var(--light);
}

.header-orange .nav-link:hover {
    color: var(--dark);
}

.header-orange .nav-link.active {
    color: var(--light);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-orange .nav-link.active::after {
    background: var(--light);
}

/* Logo colors - OTTOMIE should be white/light on orange background */
.header-orange .header-logo {
    color: var(--light);
}

.header-orange .menu-toggle span {
    background: var(--light);
}

/* When scrolled, revert to normal colors */
.header-orange.scrolled .nav-link {
    color: var(--dark);
}

.header-orange.scrolled .nav-link:hover,
.header-orange.scrolled .nav-link.active {
    color: var(--primary);
}

.header-orange.scrolled .nav-link.active {
    font-weight: 600;
    text-shadow: none;
}

.header-orange.scrolled .nav-link.active::after {
    background: var(--primary);
}

.header-orange.scrolled .header-logo {
    color: var(--primary);
}

.header-orange.scrolled .menu-toggle span {
    background: var(--dark);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    color: var(--primary);
    letter-spacing: 3px;
    z-index: 10;
}

.header-logo img {
    height: 45px;
    transition: transform var(--transition-base);
}

.header-logo:hover img {
    transform: rotate(-10deg) scale(1.05);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xl);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-link {
    position: relative;
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--dark);
    padding: var(--spacing-xs) 0;
    transition: color var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--light) !important;
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-primary);
    transition: all var(--transition-base);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
    color: var(--light) !important;
}

.nav-cta::after {
    display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--spacing-sm);
    z-index: 10;
}

.menu-toggle span {
    width: 26px;
    height: 3px;
    background: var(--dark);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

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

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

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--transition-bounce);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1em;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--light);
    box-shadow: var(--shadow-primary);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-primary-lg);
}

/* Secondary Button */
.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border-color: var(--dark);
}

.btn-secondary:hover {
    background: var(--dark);
    color: var(--light);
    transform: translateY(-3px);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--light);
    transform: translateY(-3px);
}

/* Light Button */
.btn-light {
    background: var(--light);
    color: var(--primary);
}

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

/* Button Sizes */
.btn-sm {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--text-base);
}

.btn-block {
    width: 100%;
}

/* ===== Cards ===== */
.card {
    background: var(--light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-bounce);
}

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

.card-image {
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: auto;
    transition: transform var(--transition-slow);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: var(--spacing-xl);
}

.card-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--dark);
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.card-text {
    font-size: var(--text-sm);
    color: var(--text-light);
    line-height: 1.6;
}

/* Product Card */
.product-card {
    background: var(--light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-bounce);
    cursor: pointer;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    transition: height var(--transition-base);
}

.product-card.chicken::before { background: linear-gradient(90deg, var(--product-chicken), #FFC107); }
.product-card.vegetable::before { background: linear-gradient(90deg, var(--product-vegetable), #8BC34A); }
.product-card.special::before { background: linear-gradient(90deg, var(--product-special), #FF5722); }
.product-card.curry::before { background: linear-gradient(90deg, var(--product-curry), var(--primary)); }

.product-card:hover::before {
    height: 100%;
    opacity: 0.1;
}

.product-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.product-card-image {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.product-card-image img {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    transition: all var(--transition-slow);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.product-card:hover .product-card-image img {
    transform: scale(1.1) rotate(-5deg);
}

.product-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--dark);
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.product-card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.product-card-features {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.product-card-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--text-xs);
    color: var(--text-light);
}

.product-card-feature i {
    color: var(--primary);
}

/* Recipe Card */
.recipe-card {
    background: var(--light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-bounce);
    cursor: pointer;
}

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

.recipe-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-card-image img {
    transform: scale(1.1);
}

.recipe-card-time {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.7);
    color: var(--light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.recipe-card-difficulty {
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
}

.recipe-card-difficulty.easy { background: var(--accent-green); color: var(--light); }
.recipe-card-difficulty.medium { background: var(--secondary); color: var(--dark); }
.recipe-card-difficulty.hard { background: var(--accent-red); color: var(--light); }

.recipe-card-body {
    padding: var(--spacing-lg);
}

.recipe-card-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--dark);
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.recipe-card-description {
    font-size: var(--text-sm);
    color: var(--text-light);
    line-height: 1.5;
}

/* Feature Card */
.feature-card {
    background: var(--light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.feature-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.feature-card:hover::after {
    width: 80%;
}

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

.feature-card-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: var(--text-2xl);
    color: var(--light);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.35);
    transition: all var(--transition-base);
}

.feature-card:hover .feature-card-icon {
    background: linear-gradient(135deg, var(--primary-dark), var(--dark));
    color: var(--light);
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 35px rgba(var(--primary-rgb), 0.5);
}

.feature-card-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--dark);
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.feature-card-text {
    font-size: var(--text-sm);
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--light);
}

.badge-secondary {
    background: var(--secondary);
    color: var(--dark);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: var(--light);
    padding: var(--spacing-4xl) var(--spacing-2xl) var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-3xl);
    max-width: var(--container-xl);
    margin: 0 auto var(--spacing-3xl);
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    color: var(--primary);
    letter-spacing: 3px;
    margin-bottom: var(--spacing-lg);
}

.footer-description {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.footer-social {
    display: flex;
    gap: var(--spacing-md);
}

.footer-social a {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    font-size: var(--text-base);
    transition: all var(--transition-base);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--light);
    letter-spacing: 2px;
    margin-bottom: var(--spacing-lg);
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: var(--spacing-sm);
}

.footer-bottom {
    padding-top: var(--spacing-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-xl);
    margin: 0 auto;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
}

.footer-hashtag {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Scroll to Top ===== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    font-size: var(--text-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-primary);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-primary-lg);
}

/* ===== Page Header / Breadcrumb ===== */
.page-header {
    padding: calc(var(--header-height) + var(--spacing-3xl)) 0 var(--spacing-3xl);
    background: linear-gradient(135deg, var(--cream) 0%, #FFE4CC 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.05;
}

.page-header-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: 3px;
    margin-bottom: var(--spacing-md);
}

.page-header-description {
    font-size: var(--text-lg);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    font-size: var(--text-sm);
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--primary);
    font-weight: 500;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--dark);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    transition: all var(--transition-base);
    background: var(--light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* ===== Responsive Components ===== */
@media (max-width: 992px) {
    .header {
        padding: 0 var(--spacing-lg);
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--light);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right var(--transition-base);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu .nav-link {
        font-size: var(--text-lg);
        padding: var(--spacing-md);
    }

    .nav-cta {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 var(--spacing-md);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        max-width: 100%;
    }

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

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .page-header {
        padding: calc(var(--header-height) + var(--spacing-2xl)) var(--spacing-md) var(--spacing-2xl);
    }
}

@media (max-width: 480px) {
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
    }

    .btn-lg {
        padding: var(--spacing-md) var(--spacing-xl);
    }

    .scroll-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}
