@page {
    size: A4;
    margin: 0;
}

:root {
    --background: #f0f0f0;
    --page-background: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-tertiary: #444444;
    --text-muted: #777777;
    --accent: #2c3e50;
    --accent-hover: #34495e;
    --border-color: #bdc3c7;
    --emphasis: #000000;
    --page-shadow: rgba(0, 0, 0, 0.1);
    --action-shadow: rgba(0, 0, 0, 0.3);
    --action-shadow-hover: rgba(0, 0, 0, 0.4);
    --action-shadow-active: rgba(0, 0, 0, 0.3);
    --text-on-accent: #ffffff;
}

body.dark-mode {
    --background: #1e1f29;
    --page-background: #282a36;
    --text-primary: #f8f8f2;
    --text-secondary: #e2e2f3;
    --text-tertiary: #d6d6f5;
    --text-muted: #6272a4;
    --accent: #bd93f9;
    --accent-hover: #ff79c6;
    --border-color: #44475a;
    --emphasis: #f8f8f2;
    --page-shadow: rgba(68, 71, 90, 0.3);
    --action-shadow: rgba(189, 147, 249, 0.22);
    --action-shadow-hover: rgba(255, 121, 198, 0.32);
    --action-shadow-active: rgba(189, 147, 249, 0.18);
    --text-on-accent: #1e1f29;
}

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

body {
    font-family: 'Cambria', sans-serif;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-primary);
    background: var(--background);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.page {
    width: 210mm;
    height: 297mm;
    margin: 20px auto;
    background-color: var(--page-background);
    box-shadow: 0 0 10px var(--page-shadow);
    padding: 20mm;
    box-sizing: border-box;
    position: relative;
    page-break-after: always;
    display: flex;
    flex-direction: column;
}

.page:last-child {
    page-break-after: avoid;
}

.content {
    flex: 1;
}

.header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.name {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.contact-primary {
    font-size: 11px;
    color: var(--text-secondary);
}

.title {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
}

.contact-secondary {
    font-size: 11px;
    color: var(--text-secondary);
}

.contact-secondary a {
    color: var(--text-secondary);
    text-decoration: none;
}

.contact-secondary a:hover {
    text-decoration: underline;
}

.section {
    margin-bottom: 18px;
    break-inside: avoid;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px;
    margin-bottom: 10px;
}

.job {
    margin-bottom: 12px;
    break-inside: avoid;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.company {
    font-weight: bold;
    font-size: 12px;
    color: var(--accent);
}

.position {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.duration-container {
    text-align: right;
    font-size: 10px;
    color: var(--emphasis);
    min-width: 200px;
}

.duration-main {
    font-family: 'Courier New', monospace;
    margin-bottom: 2px;
}

.duration-detail {
    font-family: 'Courier New', monospace;
}

.description-list {
    margin: 8px 0;
    padding-left: 20px;
}

.description-list li {
    margin-bottom: 4px;
    font-size: 10.5px;
    line-height: 1.4;
    color: var(--text-tertiary);
    text-align: justify;
}

.accomplishment {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    break-inside: avoid;
}

.accomplishment-content {
    flex: 1;
}

.accomplishment-title {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 2px;
    font-size: 11px;
}

.accomplishment-details {
    color: var(--text-secondary);
    font-size: 10.5px;
    line-height: 1.3;
}

.accomplishment-year {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: var(--emphasis);
    min-width: 50px;
    flex-shrink: 0;
    text-align: right;
    margin-top: 2px;
}

.education-item {
    margin-bottom: 12px;
    break-inside: avoid;
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.degree {
    font-weight: bold;
    color: var(--accent);
    font-size: 12px;
}

.university {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 2px;
}

.education-duration {
    text-align: right;
    font-size: 10px;
    color: var(--emphasis);
    font-family: 'Courier New', monospace;
    min-width: 200px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.skill-category {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    break-inside: avoid;
}

.skill-label {
    font-weight: bold;
    color: var(--accent);
    min-width: 140px;
    flex-shrink: 0;
}

.skill-items {
    color: var(--text-secondary);
    line-height: 1.3;
}

.bullet-point {
    margin-left: 15px;
    text-indent: -15px;
}

.bullet-point:before {
    content: "• ";
    color: var(--accent);
    font-weight: bold;
}

.footer {
    position: absolute;
    bottom: 10mm;
    left: 20mm;
    right: 20mm;
    text-align: center;
    font-size: 10pt;
    color: var(--text-muted);
}

.page-number {
    font-family: 'Courier New', monospace;
}

/* Continuation header for pages after the first */
.continuation-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.continuation-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
}

@media print {
    body {
        background: white !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        page-break-after: always;
        page-break-inside: avoid;
        position: relative !important;
        width: 210mm !important;
        min-height: 297mm !important;
        height: 297mm !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        background-color: #ffffff !important;
    }

    .theme-toggle,
    .theme-hint {
        display: none !important;
    }

    .page:last-child {
        page-break-after: avoid;
    }

    .web-only {
        display: none !important;
    }

    #resume-pages {
        display: block !important;
    }

    .section,
    .job,
    .accomplishment,
    .education-item,
    .skill-category {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}

/* Action Buttons */
.action-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.action-button {
    background-color: var(--accent);
    color: var(--text-on-accent);
    border: none;
    border-radius: 50px;
    padding: 15px 28px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--action-shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--action-shadow-hover);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--action-shadow-active);
}

.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--page-background);
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--page-shadow);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: visible;
    padding: 0;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--action-shadow-hover);
}

.theme-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--action-shadow-active);
}

.theme-hint {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--page-background);
    color: var(--text-secondary);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--page-shadow);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.theme-toggle:hover .theme-hint,
.theme-toggle:focus .theme-hint {
    opacity: 1;
}

.theme-hint.visible {
    opacity: 1;
}
