/* ===== Mobile Responsive Styles ===== */
/* Complete override for mobile devices */

/* Mobile Styles (max-width: 768px) */
@media screen and (max-width: 768px) {

    /* Prevent zoom and horizontal scroll */
    html {
        overflow-x: hidden !important;
        -webkit-text-size-adjust: 100%;
        touch-action: pan-y;
    }

    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        touch-action: pan-y;
    }

    /* Hide sidebar, hamburger, scroll arrows, and node connection on mobile */
    .side-nav,
    .mobile-menu-toggle,
    #node-connection-line,
    #node-connector-dot,
    #galleryNav,
    .scroll-arrow-btn,
    .gallery-nav,
    .light-rays {
        display: none !important;
    }

    /* Reset all margins */
    .main-content,
    main {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    section {
        margin-left: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ===== HERO SECTION - FULL WIDTH ===== */
    .hero-section,
    #home {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100vh;
        min-height: 100vh;
    }

    .hero-background {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
    }

    .hero-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform: none !important;
    }

    #heroVideo {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform: none !important;
        top: 0 !important;
        left: 0 !important;
    }

    .hero-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .hero-content {
        position: relative;
        z-index: 2;
        padding: 100px 20px 60px;
        text-align: center;
    }

    .hero-title {
        text-align: center;
    }

    .hero h1,
    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-name {
        font-size: 2.5rem !important;
    }

    .hero-subtitle {
        font-size: 0.85rem;
        letter-spacing: 0.15em;
    }

    .hero-description {
        font-size: 1rem;
    }

    .showreel-btn {
        margin: 20px auto;
    }

    .scroll-indicator {
        bottom: 30px;
    }

    /* ===== PROJECTS SECTION ===== */
    #projects,
    .projects-section {
        padding: 40px 15px !important;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
        width: 100%;
    }

    .project-card {
        width: 100% !important;
        aspect-ratio: 16/9;
    }

    /* Filter buttons */
    .filter-buttons,
    .filter-container,
    .filters {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px 0;
        justify-content: center;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* ===== ABOUT SECTION ===== */
    #about,
    .about-section {
        padding: 40px 20px !important;
        min-height: auto;
    }

    .about-text-container {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .about-text-column {
        max-width: 100%;
    }

    .about-text {
        font-size: 1rem;
        line-height: 1.7;
    }

    .about-text p {
        margin-bottom: 15px;
    }

    /* Headshot */
    .about-image-column {
        order: -1;
    }

    .about-headshot {
        width: 150px !important;
        max-width: 150px !important;
        height: auto !important;
        margin: 0 auto 20px;
    }

    /* Pie charts */
    .pie-charts-container {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .pie-chart-wrapper {
        width: 100%;
        max-width: 280px;
    }

    /* ===== TIMELINE - FIXED ALIGNMENT ===== */
    .career-section {
        padding: 20px 15px !important;
    }

    .timeline {
        position: relative;
        padding-left: 40px !important;
        margin-left: 0 !important;
        border-left: none !important;
    }

    /* The vertical line */
    .timeline::before {
        content: '';
        position: absolute;
        left: 15px !important;
        top: 0;
        bottom: 0;
        width: 2px;
        background: rgba(255, 255, 255, 0.2);
    }

    .timeline-item {
        position: relative;
        margin-bottom: 30px;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* The dot */
    .timeline-dot {
        position: absolute;
        left: -31px !important;
        top: 5px;
        width: 12px !important;
        height: 12px !important;
        background: #000 !important;
        border: 2px solid #fff !important;
        border-radius: 50%;
        z-index: 2;
    }

    .sub-milestone .timeline-dot {
        width: 8px !important;
        height: 8px !important;
        left: -29px !important;
    }

    .timeline-content {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    .timeline-content h4 {
        font-size: 1rem;
        margin-bottom: 3px;
    }

    .timeline-content h5 {
        font-size: 0.9rem;
    }

    .timeline-date {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.5);
    }

    /* ===== MAP SECTION - PIN FIX ===== */
    .map-section {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        position: relative;
    }

    .map-container {
        width: 100% !important;
        margin: 0 !important;
        position: relative;
    }

    .map-container iframe {
        width: 100% !important;
        height: 250px !important;
    }

    /* Map pin - position for Prague on mobile */
    .map-pin-overlay {
        position: absolute;
        top: 35% !important;
        left: 55% !important;
        transform: translate(-50%, -100%) !important;
        z-index: 10;
    }

    .map-pin-overlay svg {
        width: 32px;
        height: 32px;
    }

    /* ===== CONTACT SECTION ===== */
    #contact,
    .contact-section {
        padding: 40px 20px !important;
    }

    .contact-section h2 {
        font-size: 1.6rem;
        text-align: center;
    }

    .contact-email,
    .contact-link {
        font-size: 0.9rem;
        word-break: break-all;
        text-align: center;
        min-width: auto;
        width: 100%;
    }

    /* ===== FOOTER ===== */
    footer {
        padding: 15px 20px !important;
        text-align: center;
    }

    footer p {
        font-size: 0.7rem !important;
        line-height: 1.5;
    }

    /* ===== SOFTWARE LOGOS ===== */
    .software-logos-section {
        padding: 20px 0;
        overflow: hidden;
    }

    .software-logos-track {
        gap: 40px;
    }

    .software-logo-item {
        height: 80px;
    }

    .software-logo-item img {
        max-height: 50px !important;
    }

    /* ===== PROJECT MODAL - IMPROVED MOBILE LAYOUT ===== */
    .modal,
    .project-modal {
        padding: 0 !important;
        position: fixed;
        inset: 0;
    }

    .modal-overlay {
        position: fixed;
        inset: 0;
    }

    .modal-content,
    .project-modal .modal-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column !important;
        background: #111 !important;
    }

    .modal-close {
        position: fixed !important;
        top: 10px !important;
        right: 10px !important;
        z-index: 10002 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
    }

    /* Modal media area */
    .modal-media {
        width: 100%;
        height: auto;
        min-height: 30vh;
        max-height: 45vh;
        flex-shrink: 0;
    }

    .modal-media-main {
        width: 100%;
        height: 100%;
        max-height: 40vh;
    }

    .modal-media-main img,
    .modal-media-main video,
    .modal-media-main iframe {
        width: 100%;
        height: 100%;
        max-height: 40vh;
        object-fit: contain;
    }

    .modal-media-container {
        max-height: 40vh;
    }

    /* Modal thumbnails */
    .modal-thumbnails {
        display: flex;
        gap: 8px;
        padding: 10px;
        justify-content: center;
        flex-wrap: wrap;
        background: rgba(0, 0, 0, 0.5);
    }

    .modal-media-thumb {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    /* Modal info section */
    .modal-info {
        padding: 20px 15px;
        flex: 1;
        overflow-y: auto;
    }

    .modal-header {
        margin-bottom: 15px;
    }

    .modal-category {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .modal-title {
        font-size: 1.4rem;
        margin-top: 10px;
    }

    .modal-description {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .modal-tags {
        gap: 6px;
        padding-top: 15px;
    }

    .modal-tag {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .modal-body {
        display: flex;
        flex-direction: column;
    }

    /* ===== BLOG ===== */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card {
        margin-bottom: 20px;
    }

    /* Show More button */
    .show-more-btn {
        width: 100%;
        max-width: 280px;
        margin: 20px auto;
        display: block;
    }
}

/* Small Mobile (max-width: 480px) */
@media screen and (max-width: 480px) {
    .hero-name {
        font-size: 2rem !important;
    }

    .hero h1,
    .hero-title {
        font-size: 1.5rem !important;
    }

    .section-title,
    h2 {
        font-size: 1.3rem;
    }

    .about-headshot {
        width: 120px !important;
        max-width: 120px !important;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .timeline {
        padding-left: 35px !important;
    }

    .timeline::before {
        left: 12px !important;
    }

    .timeline-dot {
        left: -28px !important;
        width: 10px !important;
        height: 10px !important;
    }
}