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

:root {
    --sidebar-bg: #2d3748;
    --sidebar-text: #e2e8f0;
    --sidebar-heading: #ffffff;
    --sidebar-accent: #63b3ed;
    --main-bg: #ffffff;
    --main-text: #2d3748;
    --main-text-light: #616e7e;
    --main-heading: #1a202c;
    --accent: #4299e1;
    --accent-light: #ebf8ff;
    --border: #e2e8f0;
    --skill-bar-bg: rgba(255, 255, 255, 0.15);
    --skill-bar-fill: var(--sidebar-accent);
    --tag-bg: rgba(255, 255, 255, 0.1);
    --tag-border: rgba(255, 255, 255, 0.2);
    --radius: 6px;
    --sidebar-width: 320px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--main-text);
    background: #f7fafc;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.cv-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    background: var(--main-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 40px 28px;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 28px;
}

.avatar {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 16px;
    border: 3px solid var(--sidebar-accent);
    color: var(--sidebar-heading);
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
}

.avatar:hover {
    background: url('foto.jpeg') center / cover no-repeat;
    color: transparent;
}

.sidebar h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sidebar-heading);
    margin-bottom: 4px;
}

.tagline {
    font-size: 0.9rem;
    color: var(--sidebar-accent);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar h2 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--sidebar-accent);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sidebar-accent);
}

.sidebar h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 16px;
    margin-bottom: 10px;
}

.sidebar h3:first-of-type {
    margin-top: 0;
}

/* Download button */
.download-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--sidebar-accent);
    color: var(--sidebar-bg);
    border: none;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.download-btn:hover {
    opacity: 0.85;
}

/* Contact list */
.contact-list {
    list-style: none;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.85rem;
}

.contact-icon {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.contact-list a {
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.contact-list a:hover {
    border-bottom-color: var(--sidebar-accent);
    color: var(--sidebar-heading);
}

/* Skill bars */
.skill-item {
    margin-bottom: 10px;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.skill-level {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sidebar-accent);
    font-weight: 600;
}

.skill-bar {
    height: 6px;
    background: var(--skill-bar-bg);
    border-radius: 3px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--skill-bar-fill);
    border-radius: 3px;
}

/* Language items */
.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}

.language-level {
    font-size: 0.78rem;
    color: var(--sidebar-accent);
    font-weight: 500;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
}

.interest-detail {
    margin-top: 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
}

/* Main content */
.main-content {
    padding: 40px 44px;
}

.section {
    margin-bottom: 36px;
}

.section:last-child {
    margin-bottom: 0;
}

.main-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--main-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 20px;
}

.main-content p {
    color: var(--main-text-light);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* Entries (experience, education) */
.entry {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.entry:last-of-type {
    border-bottom: none;
}

.entry:first-of-type {
    padding-top: 0;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.entry-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--main-heading);
    margin-bottom: 2px;
}

.entry-subtitle {
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 500;
}

.entry-date {
    font-size: 0.82rem;
    color: var(--main-text-light);
    font-weight: 500;
    white-space: nowrap;
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.entry-details {
    padding-left: 18px;
    font-size: 0.88rem;
    color: var(--main-text-light);
    line-height: 1.7;
}

.entry-details li {
    margin-bottom: 3px;
}

.entry-mode {
    font-size: 0.78rem;
    color: var(--main-text-light);
    margin-top: 4px;
}

.entry-tech {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 6px;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--main-text-light);
    font-size: 0.85rem;
}

/* Language switcher */
.lang-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.lang-switcher button {
    background: none;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    line-height: 0;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.lang-switcher button:hover {
    opacity: 0.8;
}

.lang-switcher button.active {
    opacity: 1;
    border-color: var(--sidebar-accent);
}

/* Language visibility */
[data-lang="en"] {
    display: none;
}

html[lang="en"] [data-lang="en"] {
    display: revert;
}

html[lang="en"] [data-lang="cs"] {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .cv-wrapper {
        grid-template-columns: 1fr;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .sidebar {
        padding: 32px 24px;
    }

    .main-content {
        padding: 32px 24px;
    }

    .entry-header {
        flex-direction: column;
        gap: 4px;
    }

    .entry-date {
        align-self: flex-start;
    }
}

/* Print */
@media print {
    body {
        background: white;
    }

    .cv-wrapper {
        margin: 0;
        box-shadow: none;
        border-radius: 0;
        max-width: none;
    }

    .sidebar {
        background: #f7fafc;
        color: #2d3748;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar h1,
    .avatar {
        color: #1a202c;
    }

    .sidebar h2 {
        color: #4299e1;
    }

    .sidebar h3 {
        color: #616e7e;
    }

    .tagline,
    .language-level {
        color: #4299e1;
    }

    .skill-bar {
        background: #e2e8f0;
    }

    .skill-fill {
        background: #4299e1;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .tag {
        background: #edf2f7;
        border-color: #e2e8f0;
        color: #2d3748;
    }

    .avatar {
        border-color: #4299e1;
    }

    .entry-tech {
        color: #4299e1;
    }

    .sidebar .contact-list li,
    .sidebar .skill-header,
    .sidebar .interest-detail,
    .sidebar .language-item {
        color: #2d3748;
    }

    .skill-level {
        color: #4299e1;
    }

    .contact-list a {
        border-bottom: none;
    }

    footer {
        display: none;
    }

    .lang-switcher,
    .download-btn {
        display: none;
    }

    .section {
        break-inside: avoid;
    }

    .entry {
        break-inside: avoid;
    }
}
