/* 1. IMPORT INTER FROM GOOGLE FONTS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

@keyframes bob {
    0%, 100% { margin-top: 0px; }
    50% { margin-top: 15px; } /* The floating height */
}

body {
    margin: 0;
    width: 100vw;
    height: 100vh;
    background-color: #dedede;
    overflow: hidden; 
    font-family: 'Inter', sans-serif;
}

/* ADD THIS so your buttons and forms match the cool new font */
input, textarea, button {
    font-family: inherit;
}

header {
    /* Covers the full viewport */
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw;
    /* dvh stands for 'dynamic viewport height' - it ignores the mobile address bar! */
    height: 100dvh; 
    
    /* Dead-centering using Flexbox */
    display: flex;
    justify-content: center;
    align-items: center;
    
    z-index: 9999; 
    pointer-events: none; /* Allows you to click things 'behind' the logo */
}


/* =========================================
   ABOUT PAGE MODAL (Retro-Tech Style)
========================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 10000; /* Forces the modal to the very front! */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fff; /* White base to match the contact card */
    margin: 5% auto;
    padding: 40px;
    width: 90%;
    max-width: 600px; /* Slightly narrower for better reading */
    position: relative;
    max-height: 85vh;
    overflow-y: auto; 
    
    /* THE UPGRADE: Sharp corners and 3D floating shadow */
    border-radius: 0px; 
    border: 3px solid #222;
    box-shadow: 12px 12px 0px #2196F3;
}

/* The Employee Photo */
#modal-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 30px;
    box-sizing: border-box;
    
    /* Give the image its own retro sticker vibe! */
    border-radius: 0px; 
    border: 3px solid #222; 
    box-shadow: 6px 6px 0px #ceff00; /* Neon yellow accent shadow */
}

/* The Employee Name */
#modal-title {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    color: #222;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

/* The Employee Bio */
#modal-text {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* The "X" close button */
.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    color: #222;
    z-index: 100;
    line-height: 1;
    transition: transform 0.1s, color 0.1s;
}

.close-button:hover { 
    color: #2196F3; /* Lights up blue on hover */
    transform: scale(1.1);
}


nav a, .project-card {
    position: absolute;
    cursor: pointer;
    text-decoration: none;
    transform-origin: center;
    
    opacity: 0; /* NEW: Start completely invisible */
    
    transform: translate(calc(-50% + var(--pushX, 0px)), calc(-50% + var(--pushY, 0px))) rotate(var(--r, 0deg));
    animation: bob 6s ease-in-out infinite;
}

/* Add this new class below the block above */
.ready {
    opacity: 1; /* NEW: Fade into view! */
    transition: transform 0.8s ease-out, opacity 1.2s ease-out; /* Smooth 1.2-second fade */
}

nav a {
    z-index: 50;
    pointer-events: auto;
}

.project-card {
    z-index: 10;
    width: 300px; /* Give project cards a set width */
    height: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.1);
}

/* Pops above others on hover, but stays behind the fixed logo */
nav a:hover, .project-card:hover {
    animation: none !important;
    transform: translate(-50%, -50%) rotate(0deg) scale(1.15) !important;
    z-index: 100; 
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    
}

/* Creates a smooth intro fade for the logo */
@keyframes logoIntro {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

.logo_centered {
    display: block;
    width: 1000px;
    height: auto;
    margin: 0;
    animation: logoIntro 1s ease-out forwards; /* Triggers the animation on load */
}


nav a {
    text-decoration: none;
    border: none;
    outline: none;
}

nav a img {
    vertical-align: middle;
    border-style: none;
}

.link-text {
    display: none;
}

.nav-icon {
    width: 180px;
    height: 180px;
    transition: transform 0.2s;

}

.nav-icon:hover {
    transform: scale(1.15);
}

.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* =========================================
   TABLET & MOBILE OPTIMIZATIONS
========================================= */

/* --- 1. LAYOUT FIXES FOR ALL TOUCH SCREENS (Tablets + Phones) --- */
@media (max-width: 1366px) and (pointer: coarse) {
    /* Restore robust scrolling for touch devices */
    body {
        overflow-y: auto !important;
        overflow-x: hidden;
        height: auto;
    }
    
    /* Turn the project grid into a scrollable flexbox container */
    .project-grid {
        position: relative;
        width: 100vw;
        min-height: 100vh;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        padding-top: 180px; /* Extra padding so they don't hide under the logo */
        padding-bottom: 150px;
        gap: 15px; /* Nice breathing room for big tablet screens */
    }

    /* Override the absolute scatter positioning to fit the grid */
    .project-card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: -5px !important;
        transform: rotate(var(--r, 0deg)) !important;
        transition: transform 0.4s ease-out, opacity 0.6s ease-out;
    }
}

/* --- 2. SIZE SHRINKERS SPECIFICALLY FOR PHONES (< 768px) --- */
@media (max-width: 768px) {
    /* Scale down the logo so it doesn't overflow */
    .logo_centered {
        width: 70vw; 
        max-width: 400px;
    }

    /* Scale down the project cards to fit side-by-side */
    .project-card {
        width: 140px; 
        height: 140px;
        margin: -8px !important; /* Tighter overlap for phones */
    }
    
    /* Tighter grid spacing for small screens */
    .project-grid {
        gap: 1px;
        padding-top: 120px;
    }

    /* Scale down the nav icons */
    .nav-icon {
        width: 130px;
        height: 130px;
    }

    /* Make text modals more readable */
    .modal-content {
        width: 90%;
        margin: 5% auto;
        padding: 20px;
        max-height: 85dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    #modal-body img {
        max-height: 40vh;
        object-fit: cover;
        width: 100%;
    }
}

/* --- THEATER VIDEO OVERLAY --- */
/* --- THEATER VIDEO OVERLAY --- */
#video-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 10000; /* CHANGED: Forces the video overlay to the very front! */
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95); /* Pitch black with slight transparency */
    backdrop-filter: blur(10px);
}

#video-container {
    display: block !important; 
    width: 90% !important;
    max-width: 1000px;
    height: auto !important; 
    max-height: 90vh !important; 
    margin: 5vh auto;
    background-color: #dedede; 
    border-radius: 15px;
    overflow-y: auto !important; 
    overflow-x: hidden;
    position: relative;
    box-shadow: 0px 10px 40px rgba(0,0,0,0.8);
    -webkit-overflow-scrolling: touch;
}

/* Keeps Cinematic Mode edge-to-edge without the gray frame */
#video-container.cinematic-mode {
    padding: 0 !important;
}

/* 1. The Main Hero Video */
.hero-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9; 
    background: #000;
    /* Rounds only the top corners so it fits perfectly inside the gray container */
    border-top-left-radius: 15px; 
    border-top-right-radius: 15px;
    overflow: hidden;
}

.hero-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================
   2. RETRO-TECH FLOATING SQUARES
========================================= */
.project-details {
    padding: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px; 
}

/* THE FLOATING SQUARES (Shared Retro Style) */
.project-details h1, 
.project-details .main-desc, 
.detail-text {
    
    /* 2. The Retro Computer Window Look */
    border: none; 
    box-shadow: 12px 12px 0px #2196F3; /* 3D Electric Blue Shadow */
    
    padding: 20px;
    position: relative;
    z-index: 10; /* Ensures the text stays ON TOP of the videos */
    width: 80%; 
    max-width: 600px;
    box-sizing: border-box;

    /* NEW: Forces massive unbroken text to wrap instead of breaking the box! */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* --- SQUARE 1: THE TITLE --- */
.project-details h1 {
    /* Default spacing so it stays safely inside the box when there is NO video */
    margin: 40px auto 20px 5%; 
    
    font-size: 60px;
    font-weight: 900;
    text-transform: uppercase;
    color: #222;
    background: #ceff00; /* Your neon yellow theme! */
    letter-spacing: -1px;
    line-height: 0.8;
}

/* THE MAGIC FIX: Pulls the title UP to overlap the video perfectly! */
.hero-video + .project-details h1 {
    margin-top: 20px; 
}

/* --- SQUARE 2: MAIN DESCRIPTION --- */
.project-details .main-desc {
    /* MAGIC: 'auto' on the left pushes it to the right side of the screen */
    margin: 0px 5% 40px auto; 
    
    font-size: 16px;
    line-height: 1.4;
    color: #fff;
    background: #222; /* Dark terminal look */
    
    /* Flips the shadow to the other side for a chaotic layout */
    box-shadow: -12px 12px 0px #2196F3; 
}

/* --- SQUARE 3+: EXTRA DYNAMIC TEXT BLOCKS --- */
.detail-text {
    /* MAGIC: -40px pulls these UP so they overlap the corners of the extra images/videos you add in the admin panel! */
    margin: -40px auto 40px 5%; 
    
    background: #fff;
    color: #222;
    font-size: 16px;
    line-height: 1.4;
}

/* (Optional) Makes every other extra text block flip to the right side */
.detail-text:nth-child(even) {
    margin: -40px 5% 40px auto;
    background: #2196F3;
    color: #fff;
    box-shadow: -12px 12px 0px #222;
}

/* 3. The Dynamic Extra Blocks */

.detail-image {
    width: 100%;
    border-radius: 0 !important; /* Removed rounded corners */
    margin-bottom: 0 !important; /* Removed bottom gap */
    display: block;
}

.detail-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9; /* Forces a perfect widescreen box */
    margin-bottom: 0 !important; /* Removed bottom gap */
    border-radius: 0 !important; /* Removed rounded corners */
    overflow: hidden;
}
.detail-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 !important;
}


/* Make the close button stand out */
#video-overlay .close-button {
    position: absolute;
    right: 40px;
    top: 20px;
    font-size: 60px;
    color: white;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.2s;
}

#video-overlay .close-button:hover {
    color: #ceff00;
}

/* Makes the employee cards larger than the standard 300px project cards */
.about-card {
    width: 400px; 
    height: 400px;
}

/* Make sure they scale down nicely on mobile screens too! */
@media (max-width: 768px) {
    .about-card {
        width: 200px; /* A bit larger than the standard 140px mobile project cards */
        height: 200px;
    }
}

/* --- CONTACT PAGE SPECIFICS --- */
.contact-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100; /* Puts it above the logo */
    pointer-events: none;
}

.contact-card {
    background: #fff;
    padding: 40px;
    width: 90%;
    max-width: 450px; /* Made slightly wider to look better with the new inputs */
    text-align: center;
    animation: bob 6s ease-in-out infinite; 
    pointer-events: auto;
    
    /* THE UPGRADE: Removes the soft shadow and adds the cool 3D Retro Shadow! */
    border-radius: 0px; 
    box-shadow: 12px 12px 0px #2196F3;
}

.contact-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    color: #222;
    letter-spacing: -1px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-form label {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
    color: #222;
    text-transform: uppercase;
}

/* Upgraded Inputs: Sleek gray background with a blue border on click */
.contact-form input, 
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background: #f4f4f4;
    border: 2px solid transparent; 
    border-radius: 0px; /* Sharp corners to match the card */
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.3s, background 0.3s;
}

.contact-form input:focus, 
.contact-form textarea:focus {
    outline: none;
    border-color: #2196F3;
    background: #fff;
}

/* Upgraded Button: Bold, uppercase, with a hard push effect */
.contact-form button {
    background: #ceff00;
    color: #222;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 16px;
    padding: 18px;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    box-shadow: 4px 4px 0px #222; /* Hard black shadow */
    transition: transform 0.1s, box-shadow 0.1s;
    margin-top: 10px;
}

.contact-form button:hover {
    /* Pushes the button down into the shadow to feel like a real physical click */
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #222; 
}


.contact-divider {
    margin: 20px 0;
    color: #999;
    font-size: 14px;
}

.phone-link {
    display: inline-block;
    background: #333;
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s;
}

.phone-link:hover {
    transform: scale(1.05);
}

/* =========================================
   CONTACT PAGE TABLET & MOBILE OVERRIDES
========================================= */

/* --- 1. LAYOUT FIXES FOR ALL TOUCH SCREENS (Tablets + Phones) --- */
@media (hover: none) and (pointer: coarse) {
    /* Pin the icons to the top and bottom center on all touch screens */
    .contact-page nav a:nth-child(1) {
        top: 10% !important;
        left: 50% !important;
    }
    
    .contact-page nav a:nth-child(2) {
        top: 88% !important;
        left: 50% !important;
    }
}

/* --- 2. SIZE SHRINKERS SPECIFICALLY FOR PHONES (< 768px) --- */
@media (max-width: 768px) {
    /* Shrink the form so it fits nicely between the icons */
    .contact-page .contact-card {
        padding: 20px;
        width: 85%;
        max-width: 320px;
    }

    .contact-page .contact-card h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* Make inputs slightly smaller to save vertical space */
    .contact-page .contact-form input, 
    .contact-page .contact-form textarea {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .contact-page .phone-link {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* =========================================
   CUSTOM SCROLLBAR FOR ARTICLE MODE
========================================= */

/* For Firefox */
#video-container {
    scrollbar-width: thin;
    scrollbar-color: #2196F3 #000; /* Thumb is blue, track is black */
}

/* For Chrome, Safari, and Edge */
#video-container::-webkit-scrollbar {
    width: 14px; /* Slightly wider to allow for the magic border trick below */
    background-color: #000 !important; /* Blends into the dark overlay to become invisible */
    border-top-right-radius: 15px; /* Matches your white box's rounded corners */
    border-bottom-right-radius: 15px;
}

#video-container::-webkit-scrollbar-track {
    background-color: #000 !important; 
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}

#video-container::-webkit-scrollbar-thumb {
    background-color: #2196F3 !important; 
    border-radius: 10px; 
    
    /* MAGIC TRICK: This thick black border cuts into the blue color, 
       making the slider look incredibly thin and letting it "float" in the dark! */
    border: 4px solid #000 !important; 
}

#video-container::-webkit-scrollbar-thumb:hover {
    background-color: #0b7dda !important; 
}

/* Hides the tiny square that sometimes appears in the bottom right corner */
#video-container::-webkit-scrollbar-corner {
    background-color: #000 !important;
}

/* =========================================
   CINEMATIC MODE (Video-Only Projects)
========================================= */

/* Overrides the white box and makes it a massive, invisible centering container */
#video-container.cinematic-mode {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 85vw !important;
    max-width: 1400px !important; 
    height: 80vh !important;
    max-height: none !important;
    background-color: transparent !important; /* Removes the white box */
    box-shadow: none !important;
    margin: 10vh auto !important; /* Dead center vertical alignment */
    overflow: hidden !important; 
}

/* Styles the actual iframe inside Cinematic Mode */
#video-container.cinematic-mode iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important; /* CRITICAL FIX: Removes the default browser lines */
    outline: none !important; /* Safety measure just in case */
    border-radius: 12px !important; 
    box-shadow: 0px 15px 50px rgba(0,0,0,0.9) !important; 
}

/* =========================================
   MOBILE OVERRIDES FOR RETRO SQUARES
========================================= */
@media (max-width: 768px) {
    .project-details h1, 
    .project-details .main-desc, 
    .detail-text {
        width: 90%; /* Forces the boxes to fit inside the screen */
        padding: 15px; /* Less inside padding */
    }

    .project-details h1 {
        font-size: 24px; /* Smaller title text */
        margin: 20px auto 15px auto; 
    }

    /* Makes the title overlap smaller on phones so it doesn't cover too much video */
    .hero-video + .project-details h1 {
        margin-top: 15px; 
    }

    .project-details .main-desc {
        font-size: 14px;
        margin: 0 auto 30px auto; /* Centers the box */
    }

    .detail-text {
        font-size: 14px;
        margin: -20px auto 30px auto; /* Slightly smaller overlaps */
    }

    .detail-text:nth-child(even) {
        margin: -20px auto 30px auto; 
    }
}

/* =========================================
   GLOBAL FOOTER STYLES
========================================= */
.site-footer {
    position: fixed;
    bottom: 15px;
    width: 100vw;
    text-align: center;
    z-index: 5000; /* Keeps it above the floating cards */
    
    /* MAGIC TRICK: Lets you click "through" the invisible parts of the footer */
    pointer-events: none; 
    
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.site-footer p {
    margin: 4px 0;
}

.site-footer a {
    color: #555;
    text-decoration: none;
    font-weight: 700;
    
    /* Re-enables clicking exactly on the text links */
    pointer-events: auto; 
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #2196F3; /* Lights up blue when hovered */
}

/* --- MOBILE FOOTER SCALING --- */
@media (max-width: 768px) {
    .site-footer {
        font-size: 10px; /* Shrinks the text for smaller screens */
        bottom: 10px; 
        /* Adds a subtle fade behind the text so it's readable over scrolling cards */
        background: linear-gradient(to top, #dedede 40%, transparent);
        padding-top: 15px;
    }
}

/* =========================================
   PRIVACY POLICY PAGE STYLES
========================================= */

/* Permitem scroll-ul doar pe această pagină */
.privacy-page {
    overflow-y: auto !important; 
    height: auto;
}

.privacy-wrapper {
    display: flex;
    justify-content: center;
    padding: 80px 20px 40px 20px; 
    min-height: 80vh;
    box-sizing: border-box;
}

.privacy-content {
    background: #fff;
    padding: 50px 60px;
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0px 10px 40px rgba(0,0,0,0.1);
    color: #333;
    line-height: 1.8;
    z-index: 100; 
    position: relative;
}

.privacy-content h1 {
    color: #2196F3; /* Folosim albastrul tău electric */
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.privacy-content h2 {
    font-size: 20px;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #222;
}

.privacy-content p, .privacy-content li {
    font-size: 16px;
    color: #555;
}

.privacy-content a {
    color: #2196F3;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.privacy-content a:hover {
    color: #ceff00; /* Hover în galbenul neon */
    background: #222; /* Adaugă un mic efect de fundal dark pe hover */
    padding: 0 4px;
    border-radius: 4px;
}

/* Adaptare pentru telefoane */
@media (max-width: 768px) {
    .privacy-content {
        padding: 30px 20px;
    }
    .privacy-content h1 {
        font-size: 28px;
    }
    .privacy-wrapper {
        padding-top: 60px;
    }
}

/* =========================================
   HOME PAGE SPECIFICS
========================================= */
/* Shrinks the logo on the desktop homepage */
.home-page .logo_centered {
    width: 400px; 
    max-width: 80vw;
}

/* Shrinks the logo on the mobile homepage */
@media (max-width: 768px) {
    .home-page .logo_centered {
        width: 50vw; 
        max-width: 250px;
    }
}
