/* ============================================
   Interactive CV - Denis Barakov
   Main Stylesheet
   ============================================ */

/* --- CSS Variables / Theme --- */
:root {
    --primary: #0a66c2;
    --primary-dark: #004182;
    --primary-light: #e8f4fd;
    --accent: #00b894;
    --accent-dark: #00a381;
    --bg: #f8fafc;
    --bg-alt: #ffffff;
    --text: #1a1a2e;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1100px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff !important;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: #0d7ad9;
    border-color: #0d7ad9;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 102, 194, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(10, 102, 194, 0.25);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--text);
    border: 2px solid var(--border);
    transition: var(--transition);
}
.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn svg { flex-shrink: 0; }

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.navbar.scrolled {
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
}

.nav-links {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    padding: 6px 14px;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* Active nav link — current section indicator */
.nav-link.active {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(10, 102, 194, 0.3);
}
.nav-link.active:hover {
    background: var(--primary-dark);
    color: #fff;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4fd 50%, #f0fdf4 100%);
    overflow: hidden;
}

.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.15;
    animation: float 20s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
    25% { transform: translateY(-100px) rotate(90deg); }
    50% { transform: translateY(-50px) rotate(180deg); opacity: 0.3; }
    75% { transform: translateY(-150px) rotate(270deg); }
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 120px 0 60px;
}

.hero-avatar {
    flex-shrink: 0;
}

.avatar-frame {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    animation: spin 10s linear infinite;
    border-top-color: transparent;
    border-right-color: var(--accent);
}
.avatar-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    animation: spin 15s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-letter {
    font-size: 5rem;
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-text { flex: 1; }

.hero-name {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: var(--transition);
}
.badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(10,102,194,0.15);
}

/* Clickable badges with copy buttons */
.badge-clickable {
    gap: 2px;
    padding: 4px 4px 4px 10px;
}
.badge-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--transition);
}
.badge-link:hover {
    color: var(--primary);
}
.badge-clickable a.badge-link {
    color: var(--text-light);
}
.badge-clickable a.badge-link:hover {
    color: var(--primary);
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.5;
    flex-shrink: 0;
}
.copy-btn:hover {
    opacity: 1;
    background: var(--primary-light);
    color: var(--primary);
}
.copy-btn.copied {
    opacity: 1;
    color: #22c55e;
    background: #f0fdf4;
}
.copy-btn svg {
    display: block;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    justify-content: center;
    padding-bottom: 40px;
}
.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
    opacity: 0.5;
}
.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s ease-in-out infinite;
}
@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* --- Sections --- */
.section {
    padding: 100px 0;
}
.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.title-icon {
    font-size: 1.8rem;
}

/* About */
.about-content {
    max-width: 800px;
}
.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
}
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

.timeline-dot {
    position: absolute;
    left: -33px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--primary);
}
.section-alt .timeline-dot {
    border-color: var(--bg-alt);
}

.timeline-content {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    transition: var(--transition);
}
.timeline-content:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}
.section-alt .timeline-content {
    background: var(--bg);
}

.timeline-date {
    display: inline-block;
    padding: 2px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.timeline-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.timeline-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 4px;
}
.timeline-field {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 8px;
}

.timeline-highlights {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding-left: 4px;
    border-left: 3px solid var(--accent);
    padding-left: 14px;
}

.timeline-highlight {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
    position: relative;
}

.timeline-highlight::before {
    content: '✦';
    color: var(--accent);
    position: absolute;
    left: -14px;
    font-size: 0.7rem;
    top: 2px;
}

/* Certifications Grid */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.cert-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}
.cert-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.cert-card:hover::before {
    opacity: 1;
}

.cert-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.cert-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.cert-issuer {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 4px;
}
.cert-date {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.cert-desc {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}
.cert-link {
    font-size: 0.88rem;
    font-weight: 600;
}

/* Skills */
.skills-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.skill-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.skill-card:hover {
    border-color: #22c55e;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}
.section-alt .skill-card {
    background: var(--bg-alt);
}
.section-alt .skill-card:hover {
    background: #f0fdf4;
}

.skill-card-check {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}

.skill-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* Languages */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.lang-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}
.lang-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.lang-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.lang-level-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 8px;
}
.lang-level-progress {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-level-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, var(--text) 0%, #16213e 100%);
    color: white;
}
.contact-section .section-title {
    color: white;
}
.contact-section .title-icon {
    filter: none;
}

.contact-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}
.contact-item svg {
    flex-shrink: 0;
    color: var(--accent);
}
.contact-item a {
    color: rgba(255,255,255,0.85);
}
.contact-item a:hover {
    color: white;
}

.contact-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.contact-actions .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.contact-actions .btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}
.contact-actions .btn-outline {
    color: white;
    border-color: rgba(255,255,255,0.3);
}
.contact-actions .btn-outline:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
    box-shadow: none;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* Install Notice */
.install-notice {
    padding-top: 70px;
    background: #fff3cd;
    color: #856404;
    text-align: center;
    padding-bottom: 20px;
}
.install-notice .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Hero About (inline in hero section) */
.hero-about {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    max-width: 100%;
}
.hero-about-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    padding: 20px 24px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: var(--radius);
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.document-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    opacity: 0;
    transition: var(--transition);
}
.document-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.document-card:hover::before {
    opacity: 1;
}
.document-icon {
    margin-bottom: 12px;
}
.document-emoji {
    font-size: 2rem;
    line-height: 1;
}
.document-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.document-number {
    font-size: 0.88rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
}
.document-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.document-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.document-expiry {
    color: #d97706;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* --- Animations --- */
[data-aos] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}
[data-aos][data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos][data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos][data-aos-delay="300"] { transition-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        padding-top: 100px;
    }
    .hero-name {
        font-size: 2.2rem;
    }
    .hero-badges {
        justify-content: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .avatar-frame {
        width: 160px;
        height: 160px;
    }
    .avatar-letter {
        font-size: 3.5rem;
    }
    .section-title {
        font-size: 1.7rem;
    }
    .section {
        padding: 60px 0;
    }
    .certs-grid {
        grid-template-columns: 1fr;
    }
    .languages-grid {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-alt);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-links.active {
        display: flex;
    }
    .nav-toggle {
        display: flex;
    }
    .contact-actions {
        flex-direction: column;
    }
    .contact-actions .btn {
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-name {
        font-size: 2.6rem;
    }
    .certs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Flash Message --- */
.flash-message {
    padding: 16px 24px;
    background: #d4edda;
    color: #155724;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* --- Admin Link --- */
.admin-link {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999;
}
.admin-link a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: var(--transition);
}
.admin-link a:hover {
    background: var(--text);
    color: white;
    border-color: var(--text);
}
