/* ==============================
   CSS CUSTOM PROPERTIES (Theming)
   ============================== */
:root {
    --bg-primary: #0c0f14;
    --bg-card: #11141a;
    --bg-card-alt: #161a22;
    --border-color: #1f2430;
    --border-light: #2a3040;
    --accent: #e0b76a;
    --accent-hover: #f0cc7a;
    --accent-dim: #b8944a;
    --text-primary: #ddd;
    --text-secondary: #bbb;
    --text-muted: #888;
    --text-on-accent: #1a1a1a;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.5);
    --radius: 10px;
    --radius-sm: 6px;
    --transition-speed: 0.3s;
    --font-main: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1250px;
}

/* ==============================
   RESET & BASE
   ============================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==============================
   FADE-IN ANIMATION
   ============================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cv-container {
    display: flex;
    max-width: var(--max-width);
    margin: 40px auto;
    gap: 25px;
    padding: 0 20px;
    animation: fadeIn 0.6s ease-out;
}

/* ==============================
   LEFT COLUMN
   ============================== */
.left-column {
    width: 30%;
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}

.left-column:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Profile Photo */
.profile-photo {
    position: relative;
    margin-bottom: 20px;
}

.profile-photo img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    border: 2px solid var(--border-color);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.profile-photo img:hover {
    border-color: var(--accent-dim);
    box-shadow: 0 0 20px rgba(224, 183, 106, 0.15);
}

/* Left column sections */
.section {
    margin-bottom: 25px;
}

.section h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.section ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
}

.section p {
    margin: 4px 0;
    line-height: 1.6;
}

/* ==============================
   LANGUAGE PROFICIENCY BARS
   ============================== */
.language-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.language-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.language-name {
    color: var(--text-primary);
    font-weight: 500;
}

.language-percent {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
}

.language-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-card-alt);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.language-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    border-radius: 4px;
    transition: width 0.8s ease-out;
    width: 0%; /* animated via JS or just set static — set statically in HTML inline style */
}

/* ==============================
   LINKS
   ============================== */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Contact link icons */
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.contact-link .icon {
    font-size: 1.1em;
    line-height: 1;
}

/* ==============================
   RIGHT COLUMN
   ============================== */
.right-column {
    width: 70%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ==============================
   BLOCK CARDS
   ============================== */
.block {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-speed), transform var(--transition-speed), border-color var(--transition-speed);
}

.block:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.block h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 1.35rem;
    letter-spacing: 0.5px;
}

.block p {
    margin: 8px 0;
    color: var(--text-secondary);
}

/* ==============================
   SKILL TAGS
   ============================== */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    padding: 0;
    list-style: none;
}

.tag {
    display: inline-block;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.tag:hover {
    background: rgba(224, 183, 106, 0.12);
    border-color: var(--accent-dim);
    color: var(--accent);
}

.tag--lang   { border-left: 3px solid #4a9eff; }
.tag--tool   { border-left: 3px solid #6fcf97; }
.tag--soft   { border-left: 3px solid #f2994a; }

/* ==============================
   PROJECTS
   ============================== */
.project {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.project:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.project h4 {
    color: var(--accent);
    margin: 0 0 6px 0;
    font-size: 1rem;
}

.project p {
    margin: 4px 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-tags {
    margin-top: 6px;
}

/* ==============================
   PROJECT COLLAPSIBLE GROUPS
   ============================== */
.project-group {
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card-alt);
    overflow: hidden;
}

.project-group:last-child {
    margin-bottom: 0;
}

.project-group-summary {
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent);
    background: var(--bg-card);
    border-bottom: 1px solid transparent;
    transition: background var(--transition-speed), color var(--transition-speed);
    -webkit-user-select: none;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-group-summary::-webkit-details-marker {
    display: none;
}

.project-group-summary::before {
    content: "▶";
    display: inline-block;
    font-size: 0.7rem;
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.project-group[open] > .project-group-summary {
    border-bottom-color: var(--border-color);
}

.project-group[open] > .project-group-summary::before {
    transform: rotate(90deg);
}

.project-group-summary:hover {
    background: var(--bg-card-alt);
    color: var(--accent-hover);
}

.project-group[open] {
    padding-bottom: 4px;
}

/* ==============================
   PROJECT ITEM WRAPPER
   ============================== */
.project-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.project-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.project-item:first-of-type {
    padding-top: 0;
}

/* ==============================
   PROJECT GITHUB LINK BUTTON
   ============================== */
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-decoration: none;
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
}

.project-link:hover {
    background: rgba(224, 183, 106, 0.12);
    border-color: var(--accent-dim);
    color: var(--accent);
    text-decoration: none;
}

.project-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==============================
   COLLABORATIVE PROJECT TAG
   ============================== */
.collab-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 3px 12px;
    background: rgba(155, 89, 182, 0.15);
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #bb8fce;
    letter-spacing: 0.3px;
    -webkit-user-select: none;
    user-select: none;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.collab-tag:hover {
    background: rgba(155, 89, 182, 0.25);
    border-color: rgba(155, 89, 182, 0.6);
}

/* ==============================
   PRIVATE / PROFESSIONAL LINK
   ============================== */
.private-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 5px 14px;
    background: transparent;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-speed), border-color var(--transition-speed), color var(--transition-speed);
    opacity: 0.85;
}

.private-link:hover {
    background: rgba(224, 183, 106, 0.08);
    border-color: var(--accent-dim);
    color: var(--accent);
    text-decoration: none;
    opacity: 1;
}

.private-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==============================
   QUOTE BLOCK
   ============================== */
.quote {
    text-align: center;
    font-style: italic;
    color: var(--accent);
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition-speed);
}

.quote:hover {
    box-shadow: var(--shadow-card-hover);
}

.quote p {
    margin: 0;
    font-size: 1.05rem;
}

/* ==============================
   DOWNLOAD PDF BUTTON
   ============================== */
.download-btn-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed);
    font-family: var(--font-main);
    text-decoration: none;
}

.btn-pdf:hover {
    background: var(--accent);
    color: var(--text-on-accent);
    text-decoration: none;
}

/* ==============================
   LANGUAGE TOGGLE SWITCH
   ============================== */
.lang-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    max-width: var(--max-width);
    margin: 20px auto 0;
    padding: 0 20px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.lang-switch__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color var(--transition-speed);
}

.lang-switch__label--active {
    color: var(--accent);
}

.lang-switch__toggle {
    position: relative;
    width: 46px;
    height: 24px;
}

.lang-switch__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lang-switch__slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: background var(--transition-speed), border-color var(--transition-speed);
}

.lang-switch__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--accent);
    border-radius: 50%;
    transition: transform 0.3s ease, background var(--transition-speed);
}

.lang-switch__toggle input:checked + .lang-switch__slider {
    background: var(--bg-card);
    border-color: var(--accent-dim);
}

.lang-switch__toggle input:checked + .lang-switch__slider::before {
    transform: translateX(22px);
    background: var(--accent-hover);
}

.lang-switch__toggle input:focus-visible + .lang-switch__slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==============================
   RESPONSIVE — TABLETS (≤900px)
   ============================== */
@media (max-width: 900px) {
    .cv-container {
        flex-direction: column;
        padding: 16px;
        margin: 20px auto;
    }

    .left-column,
    .right-column {
        width: 100%;
    }

    .left-column {
        margin-bottom: 0;
    }

    .block {
        padding: 16px 18px;
    }
}

/* ==============================
   RESPONSIVE — PHONES (≤600px)
   ============================== */
@media (max-width: 600px) {
    .cv-container {
        padding: 10px;
        margin: 10px auto;
        gap: 16px;
    }

    .left-column {
        padding: 16px;
    }

    .right-column {
        padding: 0;
    }

    .block {
        padding: 14px 14px;
    }

    .block h2 {
        font-size: 1.15rem;
    }

    .section h3 {
        font-size: 1rem;
    }

    .skill-tags {
        gap: 5px;
    }

    .tag {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .profile-photo img {
        max-width: 200px;
        margin: 0 auto 16px;
        display: block;
    }

    .language-header {
        font-size: 0.85rem;
    }
}

/* ==============================
   ACCESSIBILITY — SKIP LINK
   ============================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--text-on-accent);
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard users */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==============================
   PRINT STYLESHEET
   ============================== */
@media print {
    @page {
        margin: 1.5cm 1.2cm;
        size: A4;
    }

    body {
        background: white;
        color: #222;
        font-size: 11pt;
        line-height: 1.45;
    }

    .cv-container {
        display: flex;
        flex-direction: row;
        max-width: 100%;
        margin: 0;
        padding: 0;
        gap: 20px;
        animation: none;
        transform: none;
    }

    .left-column {
        width: 30%;
        background: #f5f5f5;
        border: 1px solid #ccc;
        box-shadow: none;
        padding: 18px;
        border-radius: 4px;
    }

    .left-column:hover {
        box-shadow: none;
        transform: none;
    }

    .right-column {
        width: 70%;
        padding: 0;
    }

    .block {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
        padding: 14px 18px;
        border-radius: 4px;
        break-inside: avoid;
    }

    .block:hover {
        box-shadow: none;
        transform: none;
        border-color: #ccc;
    }

    .block h2,
    .section h3,
    .project h4,
    .quote {
        color: #1a1a1a;
    }

    .quote {
        background: #f9f9f9;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .quote:hover {
        box-shadow: none;
    }

    a {
        color: #1a1a1a;
        text-decoration: underline;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    /* Hide non-essential elements */
    .profile-photo,
    .download-btn-wrapper,
    .btn-pdf,
    .lang-toggle-wrapper {
        display: none;
    }

    .tag {
        background: #eee;
        border-color: #ccc;
        color: #333;
        font-size: 8pt;
        padding: 2px 8px;
    }

    .tag:hover {
        background: #eee;
        border-color: #ccc;
        color: #333;
    }

    .tag--lang   { border-left: 3px solid #4a9eff; }
    .tag--tool   { border-left: 3px solid #6fcf97; }
    .tag--soft   { border-left: 3px solid #f2994a; }

    .language-bar-fill {
        background: #888 !important;
    }

    .language-bar-bg {
        background: #ddd;
        border-color: #ccc;
    }

    .language-percent {
        color: #333;
    }

    .contact-link .icon {
        display: none;
    }

    .section h3 {
        border-bottom-color: #ccc;
    }

    .project {
        border-bottom-color: #ddd;
    }

    /* Avoid page breaks inside sections */
    .section,
    .block,
    .project {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Reduce shadow/transform complexity */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}

/* ==============================
   FAVICON FALLBACK (emoji)
   ============================== */
/* The favicon will be set in HTML via link tag */