/* ==========================================================================
   Dorijan Dujmovic - Premium Portfolio Stylesheet
   ========================================================================== */

@import url('../assets/fonts/fonts.css');

:root {
    --color-accent: #24C4EA;
    --color-accent-glow: rgba(36, 196, 234, 0.4);
    --color-dark: #050505;
    --color-card: #0a0a0a;
    --color-border: rgba(255, 255, 255, 0.07);
}

html {
    scroll-behavior: auto;
}

html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

body {
    background-color: var(--color-dark);
    color: #ffffff;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* --- Custom Cursor (Only for pointer devices) --- */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
    
    a, button, input, textarea, select, [role="button"], .hover-target {
        cursor: none;
    }

    .cursor-dot {
        width: 8px;
        height: 8px;
        background: var(--color-accent);
        position: fixed;
        top: 0;
        left: 0;
        border-radius: 50%;
        pointer-events: none;
        z-index: 999999;
        transform: translate(-50%, -50%);
        transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                    height 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                    opacity 0.2s ease;
        will-change: left, top;
    }

    .cursor-outline {
        width: 40px;
        height: 40px;
        border: 1px solid rgba(36, 196, 234, 0.5);
        position: fixed;
        top: 0;
        left: 0;
        border-radius: 50%;
        pointer-events: none;
        z-index: 999998;
        transform: translate(-50%, -50%);
        transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                    height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                    background-color 0.3s ease, 
                    border-color 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        will-change: left, top;
    }

    .cursor-text {
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 0.15em;
        color: #000000;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        text-align: center;
        user-select: none;
    }
}

@media (hover: none) or (pointer: coarse) {
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}

/* --- Film Grain Noise Overlay --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.035;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* --- Navigation & Glassmorphism --- */
.glass-nav {
    background: rgba(5, 5, 5, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-link {
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 8px var(--color-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-accent) !important;
}

/* --- Contact Card Styles --- */
.contact-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                background-color 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: rgba(36, 196, 234, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(36, 196, 234, 0.12);
}

/* --- Mobile Menu Drawer --- */
.mobile-menu {
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* --- Logo Animation --- */
.logo-animate {
    background: linear-gradient(to right, #24C4EA 0%, #ffffff 50%, #24C4EA 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shineLogo 4s linear infinite;
    transition: transform 0.3s ease, filter 0.3s ease;
    display: inline-block;
}

.logo-animate:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 12px rgba(36, 196, 234, 0.6));
}

@keyframes shineLogo {
    to { background-position: 200% center; }
}

/* --- Preloader --- */
#loader {
    position: fixed;
    inset: 0;
    background: #050505;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-text {
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    font-weight: 900;
    overflow: hidden;
    letter-spacing: 0.25em;
}

.loader-text .char {
    display: inline-block;
    transform: translateY(100%);
    will-change: transform;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #1e1e1e;
    border-radius: 10px;
    border: 2px solid #050505;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* --- Skill Bar Glow & Shine Animation --- */
.skill-bar-inner {
    position: relative;
    box-shadow: 0 0 12px rgba(36, 196, 234, 0.45);
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    animation: shine 2.5s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* --- Kinetic Marquee --- */
.marquee-wrapper {
    overflow: hidden;
    width: 100vw;
    padding: 2.5rem 0;
    background: transparent;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-left: 50%;
    transform: translateX(-50%);
}

.marquee-inner {
    display: flex;
    white-space: nowrap;
    width: fit-content;
    will-change: transform;
}

.marquee-text {
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    font-weight: 900;
    text-transform: uppercase;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
    color: transparent;
    padding-right: 2rem;
    letter-spacing: 0.05em;
    line-height: 1;
    user-select: none;
}

/* --- Toast Notification --- */
#toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%, 60px);
    background: var(--color-accent);
    color: #000000;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 100000;
    box-shadow: 0 10px 30px rgba(36, 196, 234, 0.45);
}

#toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

/* --- Modal Styling --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 90000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #0c0c0c;
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 20px;
    max-width: 920px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0aec0;
    transition: all 0.3s ease;
    z-index: 50;
}

.close-modal:hover {
    color: var(--color-accent);
    background: rgba(36, 196, 234, 0.15);
    border-color: var(--color-accent);
    transform: rotate(90deg);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: #000000;
}

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

.modal-image {
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- Project Card Styles --- */
.project-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease, 
                opacity 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(36, 196, 234, 0.35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(36, 196, 234, 0.1);
}

.project-img-wrap {
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #070707;
}

.project-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease;
}

.project-img-wrap img.contain-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    position: relative;
    z-index: 10;
    padding: 0.75rem;
}

.project-img-wrap img.blur-bg {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    filter: blur(25px) brightness(0.6) !important;
    opacity: 0.35 !important;
    transform: scale(1.2) !important;
    pointer-events: none !important;
    z-index: 1;
}

.project-card:hover .project-img-wrap img:not(.contain-img):not(.blur-bg) {
    transform: scale(1.06);
    filter: brightness(0.85);
}

.project-card:hover .project-img-wrap img.contain-img {
    transform: scale(1.04);
    filter: brightness(1.05);
}

.project-card:hover .project-img-wrap img.blur-bg {
    transform: scale(1.25);
    opacity: 0.5;
}

/* --- Parallax Wrapper --- */
.parallax-wrap {
    height: 125%;
    width: 100%;
    position: absolute;
    top: -12%;
    left: 0;
    will-change: transform;
}

.parallax-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Back to Top --- */
#backToTop {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

#backToTop:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(36, 196, 234, 0.3);
}

/* --- Cinematic Reveal Split Words --- */
.reveal-word {
    visibility: hidden;
    display: inline-block;
    will-change: transform, opacity;
}

/* Focus States for Accessibility */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}
