/* =================================================================== */
/*                      BASE COMPONENT STYLES (DESKTOP)              */
/* =================================================================== */

/* --- Section Navigation --- */
.section-navigation {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.nav-item {
    font-family: 'Rubik', sans-serif;
    background: transparent;
    color: rgba(241, 241, 241, 0.5);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all .3s cubic-bezier(.19, 1, .22, 1);
    border: 1px solid transparent;
    text-align: center;
    min-width: 100px;
    position: relative;
    overflow: hidden;
    font-weight: 400;
}

.nav-item:hover {
    background: rgba(98, 122, 124, 0.2);
    color: rgba(241, 241, 241, 0.8);
    transform: translateX(-3px);
}

.nav-item.active {
    background: rgba(255, 56, 75, 0.1);
    color: #FF384B;
    font-weight: 500;
    transform: translateX(-3px);
    border-color: rgba(255, 56, 75, 0.3);
}

.nav-item.completed {
    color: rgba(98, 122, 124, 0.7);
}

.nav-item.completed::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: rgba(98, 122, 124, 0.7);
    border-radius: 50%;
}

/* --- Contact Icons --- */
.contact-icons {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-icon {
    background: rgba(98, 122, 124, 0.3);
    color: #F1F1F1;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid rgba(98, 122, 124, 0.5);
    transition: all .3s cubic-bezier(.19, 1, .22, 1);
}

.contact-icon:hover {
    transform: scale(1.1);
    background: #FF384B;
    border-color: #FF384B;
}

/* --- Base Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 15, 14, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #182626;
    padding: 2.5rem;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(98, 122, 124, 0.3);
    animation: scaleIn 0.3s cubic-bezier(.19, 1, .22, 1);
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: rgba(241, 241, 241, 0.6);
    transition: color .3s ease;
    background: none;
    border: none;
}

.close:hover {
    color: #FF384B;
}

.modal h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    margin-top: 0;
    color: #F1F1F1;
}

/* --- Form Styles --- */
.form-group {
    margin: 1.2rem 0;
}

.form-group label {
    font-family: 'Rubik', sans-serif;
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #F1F1F1;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    font-family: 'Inter', sans-serif;
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(98, 122, 124, 0.5);
    border-radius: 8px;
    font-size: 1rem;
    background: #050F0E;
    color: #F1F1F1;
    transition: border-color .3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #FF384B;
    outline: none;
}

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

.submit-btn {
    font-family: 'Rubik', sans-serif;
    background: #F1F1F1;
    color: #050F0E;
    padding: 1rem 2rem;
    border: 2px solid #F1F1F1;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: all .3s cubic-bezier(.19, 1, .22, 1);
    font-weight: 500;
    position: relative;
}

.submit-btn:hover {
    background: white;
    border-color: white;
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #4A5C5A;
    border-color: #4A5C5A;
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.btn-loading {
    cursor: wait;
}

.submit-btn.btn-loading .button-text {
    opacity: 0;
}

.submit-btn.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(5, 15, 14, 0.3);
    border-top-color: #050F0E;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

/* --- Specific Modal Content Sizing --- */
#contactModal .modal-content {
    max-width: 480px;
    width: 90vw;
}

#demoModal .modal-content {
    max-width: 900px;
    width: 90vw;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#profileModal .modal-content {
    max-width: 700px;
    width: 90vw;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.profile-image-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(98, 122, 124, 0.5);
    object-fit: cover;
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 2rem;
    margin: 0 0 0.25rem 0;
}

.profile-title {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.profile-location {
    font-size: 1rem;
    color: rgba(241, 241, 241, 0.6);
    margin-bottom: 1rem;
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #0077b5;
    text-decoration: none;
    font-weight: 500;
    transition: all .3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid #0077b5;
    border-radius: 20px;
    background: rgba(0, 119, 181, 0.1);
}

.linkedin-link:hover {
    background: rgba(0, 119, 181, 0.2);
    border-color: #008cce;
}

.profile-mission {
    font-size: 1.2rem;
    font-style: italic;
    padding: 1.5rem;
    border-left: 3px solid #FF384B;
    background: rgba(255, 56, 75, 0.05);
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

.profile-description {
    line-height: 1.6;
}

.profile-description p {
    margin-bottom: 1rem;
}

/* --- Hide Nav/Audio on Modal Open --- */
body.modal-is-open .mobile-header,
body.modal-is-open .contact-icons,
body.modal-is-open .section-navigation,
body.modal-is-open #audio-progress-container {
    display: none;
}

/* --- Audio Player --- */
#audio-progress-container {
    background: transparent;
    transition: background-color 0.3s, border-top-color 0.3s;
}

/* Non-interactive videos */
.chaos-video {
    pointer-events: none;
}

.chaos-video video {
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* =================================================================== */
/*                      MOBILE RESPONSIVE STYLES                       */
/* =================================================================== */
@media (max-width: 768px) {
    /* --- Main Body Padding for Fixed Nav --- */
    body {
        padding-top: calc(100px + env(safe-area-inset-top));
    }
    
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
        background: rgba(18, 27, 27, 0.8);
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
        border-bottom: 1px solid rgba(98, 122, 124, 0.2);
    }

    /* On mobile, desktop navs are hidden */
    .contact-icons, .section-navigation {
        position: static;
        transform: none;
        flex-direction: row;
        width: auto;
    }

    .mobile-header .contact-icons {
        justify-content: center;
        padding-top: calc(env(safe-area-inset-top) + 5px);
        padding-bottom: 5px;
        gap: 1.5rem;
    }
    
    .mobile-header .contact-icon {
        background: rgba(98, 122, 124, 0.3); /* Restore circular background like desktop */
        border: 2px solid rgba(98, 122, 124, 0.5); /* Restore circular border like desktop */
        border-radius: 50%;
        width: 40px;
        height: 40px;
    }

    .mobile-header .section-navigation {
        justify-content: center;
        padding: 0 20px 10px 20px; /* Increased left/right padding for breathing room */
        gap: 0.1rem; /* Reduced gap to bring buttons closer together */
        flex-wrap: nowrap;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .mobile-header .section-navigation::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-header .nav-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem; /* Reduced padding to make buttons smaller and closer */
        min-width: unset;
        white-space: nowrap;
        overflow: visible;
        border-radius: 15px;
    }
    
    .mobile-header .nav-item.active {
        transform: none;
    }
    
    .mobile-header .nav-item.completed::after {
        display: none;
    }

    /* --- Mobile Modal Overhaul --- */
    .modal {
        padding: 0;
        background: #182626;
        backdrop-filter: none;
        align-items: stretch;
        justify-content: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        width: 100%;
        min-height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
        overflow-y: visible;
        padding: calc(env(safe-area-inset-top) + 60px) 20px calc(env(safe-area-inset-bottom) + 40px) 20px;
        margin: 0;
        text-align: center;
    }
    
    /* Consistent Modal Header */
    .modal h2 {
        position: fixed;
        top: calc(env(safe-area-inset-top) + 15px);
        left: 20px;
        font-size: 1.5rem;
        max-width: calc(100% - 80px);
        z-index: 2002;
    }

    .close {
        position: fixed;
        top: calc(env(safe-area-inset-top) + 10px);
        right: 15px;
        font-size: 2.5rem;
        z-index: 2002;
    }
    
    #demoModal .video-container {
        width: 100%;
        margin-top: 1rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .profile-image-large {
        width: 80px;
        height: 80px;
    }

    /* --- Mobile Content Layout Stacking --- */
    .section-content {
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure containers take full width */
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }

    .pillars-container,
    .transformation-content,
    .industry-examples {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        align-items: stretch;
    }
    
    /* Transformation Section Mobile Fixes */
    .chaos-section,
    .structured-section {
        max-width: 100%;
        width: 100%;
        flex: 1;
    }
    
    .chaos-videos {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        width: 100%;
        height: auto;
        min-height: 200px;
        gap: 0.5rem;
    }
    
    .structured-content {
        width: 100%;
        height: auto;
        min-height: 200px;
    }

    #depth .intelligence-examples {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
        width: 100%;
    }
    
    #depth .intelligence-item {
        width: 100%;
        max-width: 100%;
        flex: 1;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    .pillar-left,
    .pillar-right {
        text-align: center; /* Keep center alignment for most content */
        max-width: 100% !important;
        flex-basis: auto;
        width: 100% !important;
        flex: 1 1 100% !important;
        margin: 0;
        padding: 0 1rem 1rem 1rem; /* Add bottom padding for breathing room */
        box-sizing: border-box;
    }
    
    /* Specific fixes for depth section pillars - Override desktop flex properties */
    #depth .pillar-left,
    #depth .pillar-right {
        max-width: 100% !important;
        width: 100% !important;
        flex: 1 1 100% !important;
        flex-basis: auto !important;
        margin-left: 0;
        margin-right: 0;
        min-width: 0;
        padding: 0 1rem 1rem 1rem; /* Ensure padding for inner content and bottom breathing room */
        box-sizing: border-box;
        /* Text alignment will be handled by specific rules above */
    }
    
    /* Remove extra margins from inner elements since parent has padding */
    #depth .chart-placeholder {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Reset desktop flex constraints for mobile */
    #depth .pillar-left {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    #depth .pillar-right {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
    
    .text-reveal.hero {
        white-space: normal;
    }
    
    /* MOBILE TEXT ALIGNMENT - Precise selectors for each text block */
    
    /* === CENTER ALIGNED (explicit) === */
    
    /* Foundation - Industry examples */
    #foundation .industry-title,
    #foundation .industry-question {
        text-align: center !important;
    }
    
    /* Foundation - Bottom text */
    #foundation .section-content > .text-reveal.medium:last-child {
        text-align: center !important;
    }
    
    /* Foundation - Hero text */
    #foundation .text-reveal.hero {
        text-align: center !important;
    }
    
    /* Transformation - All center texts */
    #transformation .text-reveal.hero,
    #transformation .chaos-section .text-reveal.large,
    #transformation .chaos-section .text-reveal.medium,
    #transformation .structured-section .text-reveal.large,
    #transformation .structured-section .text-reveal.medium {
        text-align: center !important;
    }
    
    /* Depth - Hero text */
    #depth .text-reveal.hero {
        text-align: center !important;
    }
    
    /* Data - Hero and bottom text */
    #data-ownership .text-reveal.hero,
    #data-ownership .bottom-statement {
        text-align: center !important;
    }
    
    /* Promise - All texts */
    #promise .text-reveal.hero,
    #promise .text-reveal.large,
    #promise .bottom-statement {
        text-align: center !important;
    }
    
    /* === LEFT ALIGNED === */
    
    /* Foundation - Pillar content */
    #foundation .pillar-left .text-reveal.large,
    #foundation .pillar-left .text-reveal.medium,
    #foundation .pillar-right .text-reveal.large,
    #foundation .pillar-right .text-reveal.medium {
        text-align: left !important;
    }
    
    /* Transformation - Capital One content */
    #transformation .structured-content .text-reveal.large,
    #transformation .structured-content .character-detail {
        text-align: left !important;
    }
    
    /* Depth - Traditional pillar ALL content */
    #depth .pillar-left .text-reveal.large,
    #depth .pillar-left .chart-placeholder,
    #depth .pillar-left .chart-placeholder div,
    #depth .pillar-left .text-reveal.medium,
    #depth .pillar-left .mobile-summary {
        text-align: left !important;
    }
    
    /* Depth - Our Intelligence pillar ALL content */
    #depth .pillar-right .text-reveal.large,
    #depth .pillar-right .intelligence-percentage,
    #depth .pillar-right .intelligence-detail,
    #depth .pillar-right .text-reveal.medium,
    #depth .pillar-right .mobile-summary {
        text-align: left !important;
    }
    
    /* Data - Both pillars content */
    #data-ownership .pillar-left .text-reveal.large,
    #data-ownership .pillar-left .text-reveal.medium,
    #data-ownership .pillar-right .text-reveal.large,
    #data-ownership .pillar-right .text-reveal.medium {
        text-align: left !important;
    }

    /* --- Mobile Video Interaction Prevention --- */
    .chaos-video {
        pointer-events: none !important;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .chaos-video video {
        pointer-events: none !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
        /* Prevent mobile video controls */
        -webkit-media-controls: none !important;
        -moz-appearance: none !important;
    }
    
    /* Prevent video popup/fullscreen on mobile */
    .chaos-video video::-webkit-media-controls {
        display: none !important;
        -webkit-appearance: none !important;
    }
    
    .chaos-video video::-webkit-media-controls-enclosure {
        display: none !important;
    }

    /* --- Mobile Audio Player --- */
    #audio-progress-container {
        background: rgba(18, 27, 27, 0.8);
        backdrop-filter: blur(12px) saturate(150%);
        -webkit-backdrop-filter: blur(12px) saturate(150%);
        border-top: 1px solid rgba(98, 122, 124, 0.2);
        padding-top: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* --- Form Notifications (Global) --- */
.form-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
    color: white;
}

.form-notification.success {
    background: #10B981;
}

.form-notification.error {
    background: #EF4444;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 12px;
}

.notification-message {
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}