/* ========================================
   Nahr Daily Routine - Premium Accordion
   ======================================== */

.ndr-container {
    display: flex;
    width: 100%;
    height: 600px; /* Fixed height for desktop impact */
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    background: #000;
    
    /* Default CSS Variables (can be overridden inline) */
    --ndr-closed-title-color: #ffffff;
    --ndr-closed-subtitle-color: #ffffff;
    --ndr-open-title-color: #ffffff;
    --ndr-open-text-color: #ffffff;
    --ndr-overlay-closed: 0.2;
    --ndr-overlay-open: 0.55;
}

/* Section Base */
.ndr-section {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    cursor: pointer;
    min-width: 100px; /* Prevent total collapse */
}

/* Backgrounds & Gradients */
.ndr-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    z-index: 1;
    background-size: cover;
    background-position: center;
}

/* Dark overlay for contrast - uses CSS variables */
.ndr-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, var(--ndr-overlay-closed));
    transition: background 0.5s ease;
}

.ndr-section:hover .ndr-bg::after,
.ndr-section.is-active .ndr-bg::after {
    background: rgba(0, 0, 0, var(--ndr-overlay-open));
}

.ndr-morning .ndr-bg {
    background: linear-gradient(135deg, #FF9966, #FF5E62);
}

.ndr-afternoon .ndr-bg {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.ndr-night .ndr-bg {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* When background image is set, add fallback gradient overlay */
.ndr-morning .ndr-bg[style*="background-image"] {
    background-color: #FF9966;
}

.ndr-afternoon .ndr-bg[style*="background-image"] {
    background-color: #4facfe;
}

.ndr-night .ndr-bg[style*="background-image"] {
    background-color: #667eea;
}

/* Hover Effects */
.ndr-section:hover {
    flex: 3; /* Expand active section */
}

.ndr-section:hover .ndr-bg {
    transform: scale(1.1);
}

/* Content Layer */
.ndr-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    width: 100%;
    padding: 20px;
    opacity: 0.9;
    transition: all 0.5s ease;
}

/* Typography - uses CSS variables for colors */
.ndr-title {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.5s ease, color 0.5s ease;
    color: var(--ndr-closed-title-color);
}

.ndr-subtitle {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 10px;
    opacity: 0.8;
    transform: translateY(20px);
    transition: all 0.5s ease;
    color: var(--ndr-closed-subtitle-color);
}

/* Hover/Active state colors */
.ndr-section:hover .ndr-title,
.ndr-section.is-active .ndr-title {
    color: var(--ndr-open-title-color);
}

.ndr-section:hover .ndr-subtitle,
.ndr-section.is-active .ndr-subtitle {
    color: var(--ndr-open-text-color);
}

/* Hidden Details (Reveal on Hover) */
.ndr-details {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    width: 80%;
    margin: 0 auto;
}

.ndr-section:hover .ndr-details {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 20px;
}

.ndr-section:hover .ndr-title {
    transform: scale(1.1);
}

.ndr-section:hover .ndr-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* Description Text - uses CSS variable for color */
.ndr-details p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    color: var(--ndr-open-text-color);
}

/* CTA Button */
.ndr-btn {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.ndr-btn:hover {
    background: #fff;
    color: #333;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Product Preview Cards (Glassmorphism) */
.ndr-product-preview {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.ndr-prod-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease 0.1s;
    text-align: center;
    min-width: 100px;
    text-decoration: none;
    color: #fff;
}

.ndr-prod-card:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.ndr-prod-card img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: rgba(255,255,255,0.1);
}

.ndr-prod-card .ndr-prod-name {
    display: block;
    font-size: 0.8rem;
    line-height: 1.3;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ndr-prod-card .ndr-prod-price {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

.ndr-section:hover .ndr-prod-card {
    transform: translateY(0);
    opacity: 1;
}

.ndr-section:hover .ndr-prod-card:nth-child(2) {
    transition-delay: 0.15s;
}

.ndr-section:hover .ndr-prod-card:nth-child(3) {
    transition-delay: 0.25s;
}

.ndr-section:hover .ndr-prod-card:nth-child(4) {
    transition-delay: 0.35s;
}

/* Icon Overlay */
.ndr-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 3rem;
    opacity: 0.3;
    z-index: 2;
    transition: all 0.5s ease;
}

.ndr-section:hover .ndr-icon {
    opacity: 0.1;
    transform: scale(1.5) rotate(15deg);
}

/* ========================================
   Mobile Responsiveness
   ======================================== */
@media (max-width: 768px) {
    .ndr-container {
        flex-direction: column;
        height: auto;
    }

    .ndr-section {
        height: 120px; /* Collapsed height */
        flex: none; /* Disable flex grow logic for simple stacking initially */
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .ndr-section.is-active {
        height: 450px; /* Expanded height */
    }

    .ndr-title {
        font-size: 1.5rem;
    }

    .ndr-details {
        width: 90%;
    }
    
    /* On mobile, we rely on class toggle via JS instead of hover */
    .ndr-section:hover {
        flex: none; 
    }
    
    .ndr-section.is-active .ndr-details {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 15px;
    }

    .ndr-section.is-active .ndr-prod-card {
        transform: translateY(0);
        opacity: 1;
    }

    .ndr-product-preview {
        gap: 10px;
    }

    .ndr-prod-card {
        min-width: 80px;
        padding: 10px;
    }

    .ndr-prod-card img {
        width: 55px;
        height: 55px;
    }

    .ndr-prod-card .ndr-prod-name {
        font-size: 0.7rem;
        max-width: 70px;
    }

    .ndr-prod-card .ndr-prod-price {
        font-size: 0.65rem;
    }
}
