/* 
 * Clast Multi-page UI/UX Enhancement
 * - Depth/Shadow improvements
 * - Consistent Animations
 * - Card adjustments
 * - FAQ Component
 */

/* =========================================
   1. Theme Utilities (Shadows & Depth)
   ========================================= */
:root {
    --shadow-card: 0 4px 20px rgba(13, 148, 136, 0.08), 0 1px 3px rgba(15, 20, 18, 0.05);
    --shadow-card-hover: 0 12px 32px rgba(13, 148, 136, 0.15), 0 4px 10px rgba(234, 88, 12, 0.08);
    --transition-snappy: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);

    /* ── Motion Design Tokens ── */
    --motion-duration-fast: 450ms;
    --motion-duration-base: 680ms;
    --motion-duration-slow: 900ms;
    --motion-ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --motion-ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-stagger: 150ms;
    --motion-distance: 20px;
}

/* =========================================
   2. Enhanced Card Styles
   ========================================= */
.track-card, .mentor-card, .news-card, .learning-env__card, .compare-models__card, .class-card, .activity-card {
    transition: var(--transition-snappy);
    box-shadow: var(--shadow-card);
    background: var(--surface-elevated);
    border: 1px solid rgba(223, 217, 209, 0.6);
}

.track-card:hover, .mentor-card:hover, .news-card:hover, .learning-env__card:hover, .compare-models__card:hover, .class-card:hover, .activity-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(13, 148, 136, 0.3);
}

.track-card:active, .mentor-card:active, .class-card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

/* Mentor Card Specifics */
.mentor-card {
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.mentor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal), var(--primary-teal-bright));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mentor-card:hover::before {
    opacity: 1;
}
.mentor-card__icon {
    font-size: 2.2rem;
    color: var(--primary-teal);
    margin-bottom: 24px;
    background: var(--bg-accent);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.instructor-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.instructor-role {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.career-title {
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}
.career-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.tech-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: 100px;
    margin-right: 6px;
    margin-bottom: 6px;
    font-weight: 600;
}
.focus-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--primary-teal);
    color: var(--primary-teal);
    font-size: 0.85rem;
    border-radius: 100px;
    margin-right: 8px;
    font-weight: 600;
    background: transparent;
}

/* =========================================
   3. FAQ Accordion Components
   ========================================= */
.section-faq {
    padding: var(--section-y) 0;
}
.faq-list {
    max-width: 800px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.faq-item {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-snappy);
}
.faq-item:hover {
    border-color: rgba(13, 148, 136, 0.4);
    box-shadow: var(--shadow-md);
}
.faq-q {
    padding: 24px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    user-select: none;
}
.faq-q .faq-icon {
    color: var(--primary-teal);
    transition: transform 0.3s ease;
}
.faq-item.active .faq-q .faq-icon {
    transform: rotate(180deg);
}
.faq-a {
    padding: 0 24px 24px;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    display: none;
    animation: fadeInDown 0.3s ease forwards;
}
.faq-item.active .faq-a {
    display: block;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   4. Curriculum Page Enhancements
   ========================================= */
.courses-sticky-wrap {
    position: sticky;
    top: 72px; /* Navbar height */
    z-index: 900;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}
.courses-subnav {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.courses-subnav::-webkit-scrollbar {
    display: none;
}
.courses-subnav a {
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.courses-subnav a:hover, .courses-subnav a.active {
    background: var(--primary-teal);
    color: #fff;
}

/* =========================================
   5. Buttons & Interactions
   ========================================= */
.btn-pulse {
    position: relative;
    overflow: hidden;
}
.btn-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    opacity: 0;
}
.btn-pulse:active::after {
    width: 200px;
    height: 200px;
    opacity: 1;
    transition: 0s;
}

/* =========================================
   6. Page Specific Hero Enhancements
   ========================================= */
.page-hero {
    padding: 160px 0 80px;
    text-align: center;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-light);
}
.page-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 800;
    margin: 16px 0;
    color: var(--text-primary);
}
.page-hero .lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   7. Modals
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 20, 18, 0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.is-active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: var(--shadow-lg);
}
.modal-overlay.is-active .modal-content {
    transform: translateY(0);
}
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: var(--bg-soft);
    border: none;
    border-radius: 50%;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-snappy);
}
.modal-close:hover {
    background: var(--border-light);
    transform: rotate(90deg);
}
.modal-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-teal);
    margin: 24px 0 12px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}
.modal-list {
    margin: 0; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: 8px;
}
.modal-list li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    line-height: 1.6;
    padding-left: 16px;
}
.modal-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 0.55em;
    width: 6px; height: 6px;
    background: var(--primary-teal);
    border-radius: 50%;
}

/* =========================================
   8. Portfolio/Activity Cards
   ========================================= */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}
.portfolio-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-snappy);
    display: flex;
    flex-direction: column;
}
.portfolio-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(13, 148, 136, 0.3);
    transform: translateY(-4px);
}
.portfolio-card__body {
    padding: 24px;
    flex: 1;
}
.portfolio-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}
.portfolio-card__tech span {
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

/* =========================================
   9. Roadmap / Timeline
   ========================================= */
.roadmap-container {
    position: relative;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px 0;
}
.roadmap-container::before {
    content: '';
    position: absolute;
    top: 0; left: 16px; bottom: 0;
    width: 2px;
    background: var(--border-light);
    transform: translateX(-50%);
    z-index: 1;
}
@media (min-width: 768px) {
    .roadmap-container::before {
        left: 50%;
    }
}
.roadmap-step {
    position: relative;
    margin-bottom: 60px;
    display: flex;
    flex-direction: column;
    padding-left: 44px;
}
.roadmap-step:last-child {
    margin-bottom: 0;
}
@media (min-width: 768px) {
    .roadmap-step {
        flex-direction: row;
        align-items: center;
        padding-left: 0;
        justify-content: space-between;
    }
    .roadmap-step:nth-child(even) {
        flex-direction: row-reverse;
    }
}
.roadmap-marker {
    position: absolute;
    left: 16px; top: 0;
    transform: translateX(-50%);
    width: 32px; height: 32px;
    background: var(--primary-teal);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    z-index: 2;
    box-shadow: 0 0 0 6px white, var(--shadow-sm);
}
@media (min-width: 768px) {
    .roadmap-marker {
        left: 50%; top: 50%;
        transform: translate(-50%, -50%);
    }
}
.roadmap-content {
    background: var(--surface-elevated);
    border: 1px solid rgba(223, 217, 209, 0.6);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    width: 100%;
    position: relative;
    transition: var(--transition-snappy);
}
.roadmap-content:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-4px);
    border-color: rgba(13, 148, 136, 0.3);
}
@media (min-width: 768px) {
    .roadmap-content {
        width: 45%;
    }
}
.roadmap-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.roadmap-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.roadmap-section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.roadmap-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.6;
}
.roadmap-list {
    margin: 0 0 16px 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.roadmap-list li {
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-left: 20px;
    position: relative;
}
.roadmap-list li::before {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0; top: 2px;
    color: var(--primary-teal);
}

/* =========================================
   10. Form Embed Wrapper (apply.html)
   ========================================= */
.form-embed-wrapper {
    position: relative;
    width: 100%;
    min-height: 700px;
    background: var(--surface-elevated);
    border: 2px dashed rgba(13, 148, 136, 0.4);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
    transition: var(--transition-snappy);
}
.form-embed-wrapper:hover {
    background: #f8fafc;
}
.form-embed-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    z-index: 2;
}
.form-placeholder-text {
    z-index: 1;
    text-align: center;
    color: var(--text-secondary);
}

/* =========================================
   11. Unified Badges
   ========================================= */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}
.faq-category-badge {
    font-size: 0.8rem;
    color: var(--primary-teal);
    border: 1px solid var(--primary-teal);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    display: inline-block;
}

/* =========================================
   12. Premium Footer
   ========================================= */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.site-footer__brand-desc {
    margin-top: 20px;
    line-height: 1.6;
    max-width: 320px;
}

.site-footer__title {
    color: #f8fafc;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.site-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__links li {
    margin-bottom: 12px;
}

.site-footer__links a {
    color: #94a3b8;
    transition: color 0.2s ease;
}

.site-footer__links a:hover {
    color: var(--primary-teal-bright);
}

.site-footer__info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__info-item {
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    line-height: 1.5;
}

.site-footer__info-label {
    color: #cbd5e1;
    font-weight: 600;
    white-space: nowrap;
    min-width: 60px;
}

.site-footer__bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    gap: 20px;
}

.site-footer__copy {
    font-size: 0.8rem;
}

.site-footer__social {
    display: none;
}

.site-footer__social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    transition: all 0.3s ease;
}

.site-footer__social-link:hover {
    background: var(--primary-teal);
    transform: translateY(-3px);
}

@media (max-width: 900px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: left;
    }
    
    .site-footer__brand .logo-link {
        justify-content: flex-start;
    }

    .site-footer__brand-desc {
        max-width: none;
        margin: 16px 0 0;
    }

    .site-footer__info-item {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .site-footer__title {
        margin-bottom: 16px;
    }

    .site-footer {
        padding: 50px 0 30px;
    }
}

/* =========================================
   13. Scroll Reveal System (data-reveal)
   ========================================= */

/* Base hidden state — elements wait to be revealed */
[data-reveal] {
    opacity: 0;
    transform: translateY(var(--motion-distance));
    transition:
        opacity var(--motion-duration-base) var(--motion-ease-out),
        transform var(--motion-duration-base) var(--motion-ease-out);
    will-change: opacity, transform;
}

/* Revealed state — applied by IntersectionObserver */
[data-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays via data attribute */
[data-reveal-delay="1"] { transition-delay: calc(var(--motion-stagger) * 1); }
[data-reveal-delay="2"] { transition-delay: calc(var(--motion-stagger) * 2); }
[data-reveal-delay="3"] { transition-delay: calc(var(--motion-stagger) * 3); }
[data-reveal-delay="4"] { transition-delay: calc(var(--motion-stagger) * 4); }
[data-reveal-delay="5"] { transition-delay: calc(var(--motion-stagger) * 5); }

/* ── Hero entrance: CSS animation on load (no IO needed) ── */
.hero [data-reveal],
.page-hero [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: none;
    animation: heroReveal var(--motion-duration-base) var(--motion-ease-out) forwards;
}
.hero [data-reveal-delay="1"],
.page-hero [data-reveal-delay="1"] { animation-delay: 180ms; }
.hero [data-reveal-delay="2"],
.page-hero [data-reveal-delay="2"] { animation-delay: 360ms; }
.hero [data-reveal-delay="3"],
.page-hero [data-reveal-delay="3"] { animation-delay: 540ms; }

@keyframes heroReveal {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Roadmap marker special reveal ── */
.roadmap-marker[data-reveal] {
    transform: scale(0);
}
.roadmap-marker[data-reveal].is-revealed {
    transform: scale(1);
}

/* =========================================
   14. FAQ Accordion Smooth Height Transition
   ========================================= */
.faq-a {
    display: block !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0;
    border-top-color: transparent;
    transition:
        max-height 0.4s var(--motion-ease-out),
        opacity 0.3s ease,
        padding 0.3s ease,
        margin 0.3s ease,
        border-top-color 0.3s ease;
    /* Override old animation */
    animation: none !important;
}
.faq-item.active .faq-a {
    max-height: 500px;
    opacity: 1;
    padding-top: 15px !important;
    padding-bottom: 20px !important;
    margin-top: 5px;
    border-top-color: var(--border-light);
}

/* =========================================
   15. Modal Overlay Smooth Transition Fix
   ========================================= */
.modal-overlay {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}
.modal-overlay.is-active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

/* =========================================
   16. Mobile Motion Adjustments
   ========================================= */
@media (max-width: 768px) {
    :root {
        --motion-distance: 12px;
        --motion-stagger: 60ms;
    }

    .hero [data-reveal],
    .page-hero [data-reveal] {
        animation-duration: var(--motion-duration-fast);
    }
}

/* =========================================
   17. Accessibility: Reduced Motion
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .btn-pulse {
        animation: none !important;
    }

    .hero [data-reveal],
    .page-hero [data-reveal] {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
