/* --- RESET & GLOBAL VARIABLES --- */
:root {
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 1. GLOBALNI RESET */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* --- 2. LANDING PAGE (NASLOVNICA) --- */
body.index-page {
    position: relative;
    background-color: #000 !important;
    background-image: none !important;
    width: 100vw;
    height: 100vh;
    overflow: hidden !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

#matrix-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1; pointer-events: none;
}

.overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(2px);
    z-index: 2; pointer-events: none;
}

.landing-card {
    position: relative; 
    z-index: 100;
    background: var(--glass);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

.landing-footer {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 100;
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    animation: fadeIn 1.5s ease-in-out 1s forwards;
    opacity: 0;
}

.profile-thumb {
    width: 130px; height: 130px; border-radius: 50%;
    border: 4px solid var(--accent); object-fit: cover;
    margin-bottom: 1.5rem; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.profile-thumb:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 10px 15px rgba(37, 99, 235, 0.3);
    border-color: var(--accent-hover);
}

.landing-card h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary); }
.landing-card p { font-size: 1.1rem; color: var(--text-light); margin-bottom: 2rem; font-weight: 500; }

.lang-switch { display: flex; justify-content: center; gap: 15px; margin-bottom: 2rem; }
.lang-btn { background: transparent; border: 2px solid transparent; border-radius: 8px; padding: 5px; cursor: pointer; transition: all 0.3s; opacity: 0.6; filter: grayscale(100%); transform: scale(0.95); }
.lang-btn.active, .lang-btn:hover { opacity: 1; filter: grayscale(0%); background: rgba(37, 99, 235, 0.1); transform: scale(1.1); }
.flag-img { width: 32px; height: auto; display: block; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.cta-button {
    display: inline-block; background: var(--accent); color: white;
    padding: 14px 32px; border-radius: 50px; font-weight: 600; font-size: 1rem;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39); 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cta-button:hover { 
    background: var(--accent-hover); 
    transform: translateY(-3px) scale(1.02); 
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4); 
}

/* --- 3. CV STRANICE (ANIMACIJE) --- */
.resume-container { 
    max-width: 1000px; 
    margin: 40px auto; 
    background: var(--white); 
    border-radius: 12px; 
    box-shadow: var(--shadow); 
    overflow: hidden; 
    position: relative; 
    /* ANIMACIJA CIJELOG OKVIRA */
    animation: fadeIn 0.8s ease-out forwards;
}

.resume-header { 
    background: var(--primary); color: white; padding: 3rem 2rem; 
    display: flex; align-items: center; gap: 2rem; 
}

/* ANIMACIJE HEADER ELEMENATA */
.header-text { 
    animation: slideInRight 1s ease-out forwards; 
    opacity: 0; 
}
.resume-header .profile-thumb { 
    animation: slideInLeft 1s ease-out forwards; 
    opacity: 0; 
    border-color: white; 
}

.header-text h1 { font-size: 2.5rem; margin-bottom: 0.5rem; } 
.header-text h2 { font-size: 1.2rem; font-weight: 400; color: #cbd5e1; margin-bottom: 1.5rem; }

.contact-info { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.9rem; }
.contact-info span { display: flex; align-items: center; gap: 8px; transition: transform 0.2s; }
.contact-info span:hover { transform: translateX(3px); }
.contact-info i { color: var(--accent); }
.contact-info a { position: relative; text-decoration: none; display: inline-block; padding-bottom: 2px; }
.contact-info a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--accent); transition: width 0.3s ease; }
.contact-info a:hover::after { width: 100%; }

.resume-body { display: grid; grid-template-columns: 1fr 2fr; }

/* ANIMACIJE LIJEVOG I DESNOG STUPCA */
.left-col { 
    background: #f8fafc; padding: 2.5rem; border-right: 1px solid #e2e8f0; 
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards; /* Delay 0.3s */
}
.right-col { 
    padding: 2.5rem; background: white; 
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.5s forwards; /* Delay 0.5s */
}

h3.section-title { 
    font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; 
    color: var(--primary); border-bottom: 2px solid var(--accent); 
    padding-bottom: 0.5rem; margin-bottom: 1.5rem; 
    display: flex; align-items: center; gap: 10px; 
}

.experience-item { 
    position: relative; padding-left: 20px; margin-bottom: 2.5rem; border-left: 2px solid #e2e8f0; 
    transition: border-color 0.3s, transform 0.3s;
}
.experience-item:hover { border-left-color: var(--accent); transform: translateX(5px); }
.experience-item::before { 
    content: ''; position: absolute; left: -6px; top: 0; width: 10px; height: 10px; 
    border-radius: 50%; background: var(--accent); border: 2px solid white; 
    transition: transform 0.3s, background-color 0.3s;
}
.experience-item:hover::before { transform: scale(1.3); background-color: var(--accent-hover); }

.job-header { margin-bottom: 0.8rem; } .job-title { font-weight: 700; font-size: 1.1rem; display: block;} .company { color: var(--accent); font-weight: 600; font-size: 0.95rem; } .date { font-size: 0.85rem; color: var(--text-light); display: block; margin-top: 2px; }

/* --- LISTA POSLOVA (Sređene točkice) --- */
.job-desc {
    list-style: none;
    padding: 0;
    margin: 0;
}
.job-desc li { 
    margin-bottom: 0.5rem; 
    font-size: 0.95rem; 
    position: relative; 
    padding-left: 15px; 
    color: var(--text-dark); 
}
.job-desc li::before { 
    content: "•"; 
    color: var(--accent); 
    position: absolute; 
    left: 0; 
    font-weight: bold; 
}

.skills-group { margin-bottom: 2rem; } .skills-group h4 { font-size: 0.95rem; margin-bottom: 0.8rem; color: var(--text-light); }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { 
    background: white; border: 1px solid #cbd5e1; padding: 5px 12px; border-radius: 6px; 
    font-size: 0.85rem; font-weight: 500; cursor: default;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tag:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 6px rgba(37, 99, 235, 0.15); }

.info-box { 
    background: white; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; 
    border: 1px solid #e2e8f0; transition: transform 0.3s, box-shadow 0.3s;
} 
.info-box:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cbd5e1; }
.info-box h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; } .info-box p { font-size: 0.9rem; color: var(--text-light); } .info-desc { font-size: 0.85rem; margin-top: 0.5rem; line-height: 1.5; }

.resume-footer { text-align: center; padding: 1.5rem; background: var(--primary); color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.resume-footer a { color: white; border-bottom: 1px dotted rgba(255,255,255,0.5); }

.download-section { margin-top: 1.5rem; text-align: center; }
.download-btn { 
    display: inline-flex; align-items: center; gap: 10px; background-color: rgba(255, 255, 255, 0.1); color: white; 
    padding: 10px 25px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; 
    border: 1px solid rgba(255, 255, 255, 0.3); transition: all 0.3s ease; text-decoration: none; 
}
.download-btn:hover { background-color: white; color: var(--primary); transform: translateY(-2px); box-shadow: 0 0 15px rgba(255, 255, 255, 0.4); } 
.download-btn:hover i { color: var(--primary) !important; }

/* --- 4. KEYFRAMES ANIMACIJE --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .resume-header { flex-direction: column; text-align: center; padding: 2rem 1rem; }
    .resume-body { grid-template-columns: 1fr; }
    .left-col { border-right: none; border-bottom: 1px solid #e2e8f0; order: 2; }
    .right-col { order: 1; }
    .contact-info, .download-section { justify-content: center; width: 100%; display: flex; }
    .landing-card { padding: 1.5rem 1rem !important; width: 85% !important; max-width: 85% !important; }
    .profile-thumb { width: 100px !important; height: 100px !important; margin-bottom: 1rem !important; }
    .landing-card h1 { font-size: 1.8rem !important; }
    .landing-card p { font-size: 1rem !important; margin-bottom: 1.5rem !important; }
    .landing-footer { font-size: 0.7rem !important; bottom: 15px !important; }
}

@media print {
    body { background: white; -webkit-print-color-adjust: exact; }
    .cta-button, .landing-card, .download-section, #matrix-bg, .overlay, .landing-footer { display: none; }
    .resume-container { box-shadow: none; margin: 0; width: 100%; max-width: none; animation: none !important; }
    .left-col, .right-col, .resume-header, .header-text, .profile-thumb, .matrix-glitch { animation: none !important; opacity: 1 !important; transform: none !important; }
    .matrix-glitch::before, .matrix-glitch::after { display: none; }
}

/* =========================================
   MATRIX GLITCH EFEKT ZA IME (NASLOVNICA)
   ========================================= */

.matrix-glitch {
    position: relative;
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    transform: translateZ(0); /* Hardware Acceleration */
}

.matrix-glitch::before,
.matrix-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass);
    will-change: clip, transform;
}

.matrix-glitch::before {
    left: 2px;
    text-shadow: -1px 0 #00ff00;
    clip: rect(44px, 450px, 56px, 0);
    animation: matrix-glitch-anim 3s infinite linear alternate-reverse;
}

.matrix-glitch::after {
    left: -2px;
    text-shadow: -1px 0 #0f0;
    clip: rect(44px, 450px, 56px, 0);
    animation: matrix-glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes matrix-glitch-anim {
    0% { clip: rect(21px, 9999px, 15px, 0); transform: skew(0.7deg); }
    5% { clip: rect(68px, 9999px, 81px, 0); transform: skew(0.5deg); }
    10% { clip: rect(96px, 9999px, 86px, 0); transform: skew(0.1deg); }
    15% { clip: rect(24px, 9999px, 9px, 0); transform: skew(0.6deg); }
    20% { clip: rect(48px, 9999px, 32px, 0); transform: skew(0.4deg); }
    25% { clip: rect(1px, 9999px, 91px, 0); transform: skew(0.6deg); }
    30% { clip: rect(32px, 9999px, 35px, 0); transform: skew(0.8deg); }
    35% { clip: rect(72px, 9999px, 83px, 0); transform: skew(0.2deg); }
    40% { clip: rect(11px, 9999px, 38px, 0); transform: skew(0.9deg); }
    45% { clip: rect(54px, 9999px, 45px, 0); transform: skew(0.1deg); }
    50% { clip: rect(81px, 9999px, 66px, 0); transform: skew(0.5deg); }
    55% { clip: rect(38px, 9999px, 2px, 0); transform: skew(0.6deg); }
    60% { clip: rect(15px, 9999px, 88px, 0); transform: skew(0.2deg); }
    65% { clip: rect(94px, 9999px, 11px, 0); transform: skew(0.8deg); }
    70% { clip: rect(2px, 9999px, 49px, 0); transform: skew(0.3deg); }
    75% { clip: rect(66px, 9999px, 24px, 0); transform: skew(0.9deg); }
    80% { clip: rect(33px, 9999px, 73px, 0); transform: skew(0.7deg); }
    85% { clip: rect(19px, 9999px, 57px, 0); transform: skew(0.4deg); }
    90% { clip: rect(77px, 9999px, 95px, 0); transform: skew(0.1deg); }
    95% { clip: rect(44px, 9999px, 14px, 0); transform: skew(0.5deg); }
    100% { clip: rect(59px, 9999px, 62px, 0); transform: skew(0.2deg); }
}