/* AI Projects Page Stylesheet */
/* Component-based CSS organization for maintainability */

/* ============================================
   BASE & LAYOUT
   ============================================ */

body {
    background: #0f0f0f;
    color: #f5f5f5;
    position: relative;
    overflow-x: hidden;
}

.page-video-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.page-video-underlay iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.77vh;
    pointer-events: none;
}

.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
    pointer-events: none;
}

main {
    position: relative;
    z-index: 2;
}

.ai-projects-page {
    min-height: 60vh;
    padding-bottom: 6rem;
    padding-top: 2rem;
}

/* ============================================
   HEADER & PAGE TITLE
   ============================================ */

.page-title {
    color: #fff;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    text-align: center;
    letter-spacing: 6px;
    font-weight: 300;
    text-transform: uppercase;
}

.page-subtitle {
    text-align: center;
    color: #aaa;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* ============================================
   FEATURED PROJECT
   ============================================ */

.featured-project {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.featured-label {
    text-align: center;
    color: #888;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.featured-card {
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.featured-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

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

.featured-content {
    padding: 2rem;
}

.featured-title {
    font-size: 2rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.featured-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tool-badge {
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-radius: 3px;
    text-transform: uppercase;
}

.featured-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #e5e5e5;
    margin-bottom: 1.5rem;
}

.featured-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    font-family: 'Courier New', monospace;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.action-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.action-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   HORIZONTAL SCROLLING TIMELINE
   ============================================ */

.timeline-view {
    display: none;
}

.timeline-view.active {
    display: block;
}

.timeline-container {
    position: relative;
    width: 100%;
    padding: 4rem 0;
    margin-top: 2rem;
}

/* Floating Year Indicator */
.floating-year {
    position: absolute;
    top: 2.5rem;
    left: 2rem;
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 3px;
    pointer-events: none;
    z-index: 1;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 40px rgba(255, 255, 255, 0.5),
                 0 0 60px rgba(255, 255, 255, 0.3);
}

/* Navigation Controls - Overlay Arrows */
.timeline-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    backdrop-filter: blur(10px);
}

.timeline-nav-prev {
    left: 1rem;
}

.timeline-nav-next {
    right: 1rem;
}

.timeline-nav-btn:hover:not(:disabled) {
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.timeline-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.timeline-nav-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.timeline-page-indicator {
    color: #999;
    font-size: 0.85rem;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin-top: 0.5rem;
    display: block;
}

/* Horizontal Scroll Wrapper */
.timeline-scroll-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
}

.timeline-scroll-container {
    display: flex;
    gap: 3rem;
    padding: 0 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05);
}

.timeline-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.timeline-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.timeline-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Progress Line */
.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Project Cards in Timeline */
.timeline-project-card {
    flex: 0 0 450px;
    background: rgba(26, 26, 26, 0.98);
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    scroll-snap-align: center;
    position: relative;
    z-index: 2;
}

.timeline-project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    z-index: 3;
}

.timeline-project-card.selected {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.2),
                0 20px 60px rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
    z-index: 4;
}

.timeline-project-card:focus-within {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

/* Card Thumbnail */
.timeline-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.timeline-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.timeline-project-card:hover .timeline-thumbnail img {
    transform: scale(1.1);
}

/* Year Badge */
.timeline-year-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Card Content */
.timeline-card-content {
    padding: 1.75rem;
}

.timeline-card-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.3;
}

.timeline-card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.timeline-card-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #ccc;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline-card-btn {
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-card-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.timeline-card-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.timeline-card-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Progress Indicator */
.timeline-progress {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 0 2rem;
}

.timeline-progress-label {
    text-align: center;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.timeline-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.timeline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.8) 100%);
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ============================================
   PROJECT MODAL
   ============================================ */

.project-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.project-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-project {
    background: rgba(26, 26, 26, 0.98);
    margin: 2rem auto;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 1000px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: none;
}

.modal-close:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.9);
}

.modal-close:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: #aaa;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .page-title {
        font-size: clamp(2rem, 8vw, 3rem);
        letter-spacing: 3px;
    }

    .featured-project {
        padding: 0 1rem;
    }

    .featured-content {
        padding: 1.5rem;
    }

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

    .featured-actions {
        flex-direction: column;
    }

    .action-btn {
        text-align: center;
    }

    /* Horizontal Timeline Mobile */
    .timeline-container {
        padding: 2rem 0;
    }

    .timeline-navigation {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .timeline-nav-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .timeline-page-indicator {
        width: 100%;
        text-align: center;
        order: -1;
    }

    .timeline-scroll-container {
        padding: 0 1rem;
        gap: 1.5rem;
        scroll-snap-type: x proximity;
    }

    .timeline-project-card {
        flex: 0 0 85vw;
        max-width: 350px;
    }

    .timeline-card-content {
        padding: 1.25rem;
    }

    .timeline-card-title {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .timeline-card-description {
        font-size: 0.85rem;
    }

    .timeline-card-actions {
        flex-direction: column;
    }

    .timeline-card-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .timeline-progress {
        padding: 0 1rem;
    }

    .timeline-line {
        display: none;
    }
}

@media (max-width: 480px) {
    .tool-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .featured-title,
    .timeline-card-title {
        letter-spacing: 1px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
