* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cyan: #00fff5;
    --pink: #ff006e;
    --purple: #8338ec;
    --dark: #0a0e27;
    --card: #151932;
    --text: #ffffff;
    --text-muted: #94a3b8;
    --border: rgba(0, 255, 245, 0.2);
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    background: var(--dark);
    padding: 20px;
}

/* A11y helpers */
.skip-link {
    position: absolute;
    left: -999px;
    top: 1rem;
    z-index: 2000;
    background: var(--cyan);
    color: var(--dark);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    left: 1rem;
}

:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 4px;
}

.cv-container {
    max-width: 210mm;
    margin: 0 auto;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    position: relative;
    overflow: hidden;
}

.cv-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
}

/* Action Buttons */
.action-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.action-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.print-btn {
    background: var(--cyan);
    color: var(--dark);
    box-shadow: 0 4px 20px rgba(0, 255, 245, 0.3);
}

.print-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 245, 0.4);
}

.back-btn {
    background: var(--purple);
    color: white;
    box-shadow: 0 4px 20px rgba(131, 56, 236, 0.3);
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(131, 56, 236, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

h1 {
    font-size: 36pt;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    line-height: 1.2;
}

.job-title {
    font-size: 14pt;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 10pt;
    color: var(--text-muted);
}

.contact-info a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: var(--cyan);
}

/* Sections */
section {
    margin-bottom: 35px;
    page-break-inside: avoid;
}

h2 {
    font-size: 14pt;
    font-weight: 800;
    color: var(--cyan);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Experience */
.experience-item {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 255, 245, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 245, 0.1);
    page-break-inside: avoid;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-title {
    font-size: 13pt;
    font-weight: 800;
    color: var(--text);
}

.company {
    font-size: 11pt;
    font-weight: 700;
    color: var(--purple);
}

.date {
    font-size: 10pt;
    color: var(--pink);
    font-weight: 600;
    background: rgba(255, 0, 110, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.exp-desc {
    font-size: 10pt;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
    font-weight: 500;
}

.exp-section {
    margin-top: 12px;
}

.exp-section-title {
    font-size: 9pt;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

ul {
    list-style: none;
    padding-left: 0;
}

li {
    font-size: 10pt;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-weight: bold;
    font-size: 12pt;
}

.tech-stack {
    font-size: 9pt;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.6;
    padding: 10px;
    background: rgba(131, 56, 236, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--purple);
}

.tech-stack strong {
    color: var(--purple);
}

/* Profile */
.profile-text {
    font-size: 11pt;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Highlights */
.highlights-section {
    background: rgba(0, 255, 245, 0.05);
    margin: 0 -40px 35px;
    padding: 25px 40px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.highlight-number {
    font-size: 16pt;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-label {
    font-size: 8pt;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Core Competencies */
.competencies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.competency {
    background: rgba(0, 255, 245, 0.1);
    color: var(--cyan);
    padding: 5px 12px;
    border: 1px solid rgba(0, 255, 245, 0.3);
    border-radius: 20px;
    font-size: 9pt;
    font-weight: 600;
}

/* Education */
.edu-item {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(131, 56, 236, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(131, 56, 236, 0.2);
}

.edu-title {
    font-size: 12pt;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 5px;
}

.edu-desc {
    font-size: 10pt;
    color: var(--text-muted);
    font-weight: 500;
}

.edu-desc strong {
    color: var(--purple);
}

/* Skills Compact */
.skills-compact p {
    font-size: 10pt;
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-muted);
    padding: 8px 12px;
    background: rgba(0, 255, 245, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--cyan);
}

.skills-compact strong {
    color: var(--cyan);
}

/* ATS Keywords - hidden on screen, visible in PDF for ATS bots */
.ats-keywords {
    position: absolute;
    left: -9999px;
    font-size: 1pt;
    color: transparent;
}

/* Print Styles - Clean white version for PDF */
@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    :root {
        --cyan: #0891b2;
        --pink: #db2777;
        --purple: #7c3aed;
        --text: #1e293b;
        --text-muted: #475569;
    }

    body {
        padding: 0;
        background: white;
        color: var(--text);
    }

    .cv-container {
        padding: 0;
        max-width: 100%;
        box-shadow: none;
        border-radius: 0;
        background: white;
        border: none;
    }

    h1 {
        background: none;
        -webkit-text-fill-color: var(--text);
        color: var(--text);
    }

    h2 {
        color: var(--cyan);
        border-bottom-color: #e2e8f0;
    }

    .job-title {
        color: var(--cyan);
    }

    .experience-item {
        background: #f8fafc;
        border-color: #e2e8f0;
    }

    .date {
        background: rgba(219, 39, 119, 0.1);
        color: var(--pink);
    }

    .company {
        color: var(--purple);
    }

    .tech-stack {
        background: rgba(124, 58, 237, 0.05);
        border-left-color: var(--purple);
    }

    .highlight-number {
        background: none;
        -webkit-text-fill-color: var(--cyan);
        color: var(--cyan);
    }

    .highlights-section {
        margin: 0 0 35px;
        padding: 20px 0;
        background: #f8fafc;
    }

    .competency {
        background: rgba(8, 145, 178, 0.1);
        color: var(--cyan);
        border-color: rgba(8, 145, 178, 0.3);
    }

    .edu-item {
        background: rgba(124, 58, 237, 0.05);
        border-color: rgba(124, 58, 237, 0.2);
    }

    .skills-compact p {
        background: #f8fafc;
        border-left-color: var(--cyan);
    }

    li::before {
        color: var(--cyan);
    }

    .action-bar,
    .pdf-overlay {
        display: none !important;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    section,
    .experience-item,
    .edu-item {
        page-break-inside: avoid;
    }

    h1,
    h2,
    h3 {
        page-break-after: avoid;
    }

    /* ATS keywords - in PDF but invisible */
    .ats-keywords {
        position: static !important;
        left: auto !important;
        display: block !important;
        font-size: 1pt !important;
        line-height: 1.2 !important;
        color: #ffffff !important;
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* PDF Export Overlay */
.pdf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pdf-modal {
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-overlay.active .pdf-modal {
    transform: scale(1) translateY(0);
}

.pdf-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.pdf-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: pdf-spin 1.5s linear infinite;
}

.pdf-loader-ring:nth-child(1) {
    border-top-color: var(--cyan);
    animation-delay: 0s;
}

.pdf-loader-ring:nth-child(2) {
    inset: 10px;
    border-right-color: var(--purple);
    animation-delay: 0.15s;
    animation-direction: reverse;
}

.pdf-loader-ring:nth-child(3) {
    inset: 20px;
    border-bottom-color: var(--pink);
    animation-delay: 0.3s;
}

@keyframes pdf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pdf-status {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pdf-substatus {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Button loading state */
.print-btn {
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.print-btn .btn-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-btn .spinner {
    animation: spin 1s linear infinite;
}

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

.print-btn:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.print-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
}

.print-btn:disabled::after {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .exp-header {
        flex-direction: column;
    }

    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-bar {
        position: static;
        flex-direction: column;
        margin-bottom: 20px;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .cv-container {
        padding: 20px;
    }

    h1 {
        font-size: 28pt;
    }

    .highlights-section {
        margin: 0 -20px 35px;
        padding: 20px;
    }
}