/* ====================================================
   CUSTOM COMPLEMENTARY STYLES (Tailwind Companion)
   ==================================================== */

/* Smooth scroll & base styling */
html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #070b14;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #06b6d4;
}

/* Cyber Matrix Background Dots */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(30, 41, 59, 0.45) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 1;
}

/* Card Glow Effect on Hover */
article, section {
    position: relative;
    z-index: 2;
}

/* Image Lightbox Transitions */
#image-modal {
    transition: opacity 0.25s ease-in-out;
}
#image-modal.active {
    display: flex !important;
}

/* ====================================================
   PRINT TO PDF OPTIMIZATIONS (Ctrl + P / Window.print)
   Allows full background graphics & Landscape layout
   ==================================================== */
@page {
    /* Standard margin creates the clean white paper border around the page */
    margin: 10mm 12mm;
}

@media print {
    /* 1. White paper canvas so browser margins, date, and title have a clean white background */
    html {
        color-scheme: light !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
    }

    /* 2. Full dark portfolio design rendered inside the white margin frame */
    body {
        color-scheme: dark !important;
        background-color: #070b14 !important;
        background: #070b14 !important;
        color: #f1f5f9 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 3. Ensure full-color fidelity for all background cards and gradients */
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body::before {
        display: none !important;
    }

    /* 2. Hide interactive overlays and menu toggles */
    #network-canvas,
    #image-modal,
    #theme-toggle,
    #lang-toggle,
    #mobile-menu-btn,
    #mobile-menu,
    .no-print {
        display: none !important;
    }

    /* 3. Make header & full navbar print cleanly at the top of page 1 */
    header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        width: 100% !important;
        background: #070b14 !important;
        backdrop-filter: none !important;
        border-bottom: 1px solid rgba(51, 65, 85, 0.6) !important;
        margin-bottom: 0.5rem !important;
    }

    header .h-16 {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    /* Force navbar links to show in print (override Tailwind .hidden) */
    header nav {
        display: flex !important;
        align-items: center !important;
        gap: 0.35rem !important;
        background: rgba(15, 23, 42, 0.75) !important;
        border: 1px solid rgba(51, 65, 85, 0.7) !important;
        border-radius: 9999px !important;
        padding: 4px 10px !important;
    }

    header nav a {
        display: inline-block !important;
        font-size: 8pt !important;
        font-weight: 600 !important;
        padding: 3px 8px !important;
        color: #e2e8f0 !important;
        text-decoration: none !important;
    }

    /* Force Email CTA button to show in print (override Tailwind .hidden) */
    header a[href^="mailto:"] {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        font-size: 8pt !important;
        padding: 4px 10px !important;
    }

    /* 4. Disable animations for static printing */
    .animate-ping,
    .animate-pulse {
        animation: none !important;
    }

    /* 5. Main container spacing */
    main {
        max-width: 100% !important;
        padding-top: 1rem !important;
        margin: 0 auto !important;
    }

    /* 6. Avoid awkward page breaks inside cards */
    article,
    .case-study-box,
    #hero .lg\:col-span-5 > div,
    #contact > div,
    #about .grid > div,
    #skills .grid > div,
    #certifications .grid > div {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /* 7. Image showcase sizing for Landscape / Portrait printing */
    [class*="h-\[440px\]"],
    [class*="h-\[480px\]"],
    [class*="h-\[500px\]"],
    article .overflow-hidden {
        height: auto !important;
        min-height: 0 !important;
        max-height: 320px !important;
        padding: 8px !important;
    }

    article img {
        max-height: 300px !important;
        height: auto !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* 8. Ensure links remain clean, top-layered, and clickable */
    a {
        text-decoration: none !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* 9. Hide only decorative ambient background glow lights */
    div.blur-3xl,
    div.blur-xl,
    div.blur-2xl {
        display: none !important;
    }
}
