@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');

:root {
    --bg-color: #f0f2f5;
    --paper-color: #ffffff;
    --sidebar-bg: #f7f7f7;
    --text-color: #333333;
    --light-text-color: #666666;
    --border-color: #e0e0e0;
    --accent-color-1: #4CAF50;
    --accent-color-2: #2196F3;
    --header-gradient: linear-gradient(to right, var(--accent-color-1), var(--accent-color-2));
    --transition-speed: 0.3s ease;
}

body.dark-mode {
    --bg-color: #121212;
    --paper-color: #1e1e1e;
    --sidebar-bg: #181818;
    --text-color: #e0e0e0;
    --light-text-color: #b0b0b0;
    --border-color: #333333;
    --accent-color-1: #2e7d32; 
    --accent-color-2: #1a237e;
    --header-gradient: linear-gradient(to right, #001a33, #003311);
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.cv-wrapper {
    background-color: var(--paper-color);
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    transition: background-color var(--transition-speed);
}

.cv-header {
    background: var(--header-gradient);
    color: #ffffff;
    padding: 60px 30px;
    text-align: center;
    position: relative;
    transition: background var(--transition-speed);
}

.cv-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5em;
    margin: 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.cv-header .summary {
    font-size: 1.1em;
    max-width: 800px;
    margin: 20px auto 0;
    line-height: 1.8;
    color: rgba(255,255,255,0.85);
}

.cv-main-content {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.cv-sidebar {
    flex: 0 0 300px;
    background-color: var(--sidebar-bg);
    padding: 30px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    transition: background-color var(--transition-speed);
}

.profile-photo-desktop {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 4px solid var(--accent-color-1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: block;
}

.cv-mobile-photo-section {
    display: none !important;
}

.cv-content {
    flex: 1;
    padding: 40px;
    background-color: var(--paper-color);
    transition: background-color var(--transition-speed);
}

.cv-content h2, .cv-sidebar h2 {
    color: var(--accent-color-1);
    font-size: 1.4em;
    text-transform: uppercase;
}

.cv-content .item {
    margin-bottom: 30px;
    padding-left: 15px;
    border-left: 3px solid var(--border-color);
}

.cv-content .item:hover {
    border-left-color: var(--accent-color-1);
}

h3 { color: var(--text-color); margin-top: 0; }
p, li { color: var(--light-text-color); }

.modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

.external-link-container {
    margin-top: 20px;
    text-align: left;
}

.cv-external-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color, #4caf4fdb);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.cv-external-btn:hover {
    background-color: transparent;
    color: var(--primary-color, #2c3e50);
    border-color: var(--primary-color, #2c3e50);
}

.cv-external-btn i {
    margin-right: 8px;
}

.github-btn {
    display: inline-block;
    background-color: #333;
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: 10px;
}

.github-btn:hover {
    background-color: var(--accent-color-1);
    text-decoration: none !important;
}

.modal-content p {
    font-size: 0.95em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.language-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-switch-btn {
    background: #2196F3;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.lang-switch-btn i {
    font-size: 1.1em;
}

.lang-switch-btn:hover {
    background: var(--accent-color-1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: white;
}

.theme-wrapper {
    position: fixed;
    top: 20px;
    right: 150px;
    z-index: 1001;
}

.theme-btn {
    background: var(--accent-color-1);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.qr-hint {
    margin-top: 5px;
    font-size: 0.5rem;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
}

.lang-download-btn 
    {
        padding: 10px 20px; border-radius: 20px; cursor: pointer; background: var(--accent-color-1); color: white; border: none;
    }

body:has(#btn-en:not([style*="display: none"])) .cover-letter-extended p {
    font-size: 1rem; 
    line-height: 1.4;
}
body:has(#btn-tr:not([style*="display: none"])) .cover-letter-extended p {
    font-size: 1rem; 
    line-height: 1.4;
}

.cv-sidebar section {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

.single-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto;
    max-width: 100px;
}

.single-qr-container img {
    width: 80% !important;
    height: auto;
    border: 2px solid var(--accent-color-1);
    padding: 5px;
    border-radius: 10px;
}

.project-link {
    text-decoration: none;
    display: inline-block;
}

.project-link h3 {
    margin: 0;
    color: #2a7cb3;
    border-bottom: 2px solid #3498db;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

.project-link:hover h3 {
    color: #3498db;
    border-bottom-color: #2980b9;
    padding-left: 5px;
}

.project-item {
    margin-bottom: 25px;
}
.qr-group {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
}

.qr-hint, .lang-view-cv-text {
    margin-top: 5px;
    font-size: 8px;
    color: var(--accent-color-2);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    transition: color var(--transition-speed);
}

.references {
    border-top: 1px solid var(--border-color);
    padding-top: 20px !important;
}

.ref-item {
    margin-bottom: 25px;
    text-align: left;
}

.ref-name {
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
    color: var(--text-color) !important;
}

.ref-title {
    font-size: 0.75rem;
    color: var(--accent-color-1);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ref-contact {
    list-style: none !important;
    padding: 0 !important;
}

.ref-contact li {
    font-size: 0.85rem !important;
    color: var(--light-text-color) !important;
    margin-bottom: 4px !important;
    display: flex;
    align-items: center;
}

.ref-contact li i {
    width: 20px;
    color: var(--accent-color-2) !important;
    font-size: 0.9rem;
}

body.dark-mode .ref-name {
    color: #ffffff !important;
}

body.dark-mode .ref-contact li {
    color: var(--light-text-color) !important;
}

@media (max-width: 768px) {
    body {
        line-height: 1.4;
    }

    .cv-header {
        padding: 20px 15px;
    }

    .cv-header h1 {
        font-size: 2.0em;
    }

    .cv-content, .cv-sidebar {
        padding: 15px 10px;
    }

    .cv-content section, .cv-sidebar section {
        margin-bottom: 12px;
    }

    .about-me p, .cv-content .item p, .cv-content ul li {
        font-size: 0.87rem !important;
    }

    .single-qr-container {
        max-width: 90px;
        margin-top: 5px;
    }
}

@media print {
    html, body {
        font-size: 12pt !important;
    }

    .cv-sidebar {
        width: 65mm !important;
        min-width: 65mm !important;
    }

    .cv-content {
        width: 145mm !important;
    }

    .single-qr-container img {
        width: 25mm !important;
        height: 25mm !important;
    }
}

.cv-wrapper:hover {
    transform: none;
    box-shadow: none;
}

.cv-header:hover {
    background: linear-gradient(to right, var(--accent-color-2), var(--accent-color-1));
}

.cv-header h1:hover {
    color: var(--paper-color);
    cursor: default;
}

.cv-mobile-photo-section {
    display: none;
    box-sizing: border-box;
}

.cv-sidebar h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3em;
    color: var(--accent-color-1);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 5px;
    text-align: center;
    overflow-wrap: break-word;
}

.cv-sidebar h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-color-2);
    margin: 5px auto 0 auto;
    border-radius: 2px;
}

.cv-sidebar h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1em;
    color: var(--text-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    text-align: center;
    overflow-wrap: break-word;
}

.cv-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.cv-sidebar ul li {
    margin-bottom: 10px;
    font-size: 0.95em;
    color: var(--light-text-color);
    display: flex;
    align-items: center;
    transition: color var(--transition-speed);
    overflow-wrap: break-word;
    padding: 0 15px;
    box-sizing: border-box;
}

.cv-sidebar p, .cv-content p, .cv-content ul li {
    transition: color var(--transition-speed), transform var(--transition-speed);
    overflow-wrap: break-word;
}

.cv-sidebar p:hover, .cv-content p:hover, .cv-content ul li:hover {
    color: var(--accent-color-1);
    transform: translateX(3px);
}

.cv-sidebar ul li:hover {
    color: var(--accent-color-1);
}

.cv-sidebar ul li i {
    margin-right: 10px;
    color: var(--accent-color-2);
    font-size: 1.1em;
    transition: transform var(--transition-speed), color var(--transition-speed);
    flex-shrink: 0;
}

.cv-sidebar ul li:hover i {
    transform: scale(1.1);
    color: var(--accent-color-1);
}

.contact-info-cv .address-text {
    flex: 1;
    overflow-wrap: break-word;
}

.cv-sidebar .skills ul li,
.cv-sidebar .languages ul li {
    justify-content: flex-start;
    text-align: left;
    padding-left: 20px;
    padding-right: 15px;
}

.skill-name {
    font-weight: 600;
    color: var(--text-color);
    display: inline-block;
    overflow-wrap: break-word;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
    padding: 0 15px;
    box-sizing: border-box;
}

.social-links a {
    color: var(--accent-color-2);
    font-size: 1.8em;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover {
    color: var(--accent-color-1);
    transform: scale(1.1);
}

.cv-content h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--accent-color-2);
    margin-top: 5px;
    border-radius: 2px;
}

.about-me p {
    text-align: justify;
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--text-color);
    overflow-wrap: break-word;
}

.cv-content .item h3 {
    font-size: 1.1em;
    color: var(--text-color);
    margin: 0 0 5px 0;
    font-weight: 600;
    overflow-wrap: break-word;
}

.cv-content .item .degree,
.cv-content .item .position,
.cv-content .item .technologies {
    font-size: 0.95em;
    color: var(--light-text-color);
    margin-bottom: 5px;
    font-weight: 500;
    overflow-wrap: break-word;
}

.cv-content .item .dates {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
    font-style: italic;
    overflow-wrap: break-word;
}

.cv-content .item .description {
    font-size: 0.95em;
    margin-bottom: 10px;
    overflow-wrap: break-word;
}

.cv-content ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
    font-size: 0.95em;
    color: var(--light-text-color);
    box-sizing: border-box;
    padding-right: 15px;
}

.cv-content .item a {
    color: var(--accent-color-2);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
    overflow-wrap: break-word;
}

.cv-content .item a:hover {
    color: var(--accent-color-1);
    text-decoration: underline;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
    padding-right: 0px;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        background-color: #ffffff;
        line-height: 1.4;
    }

    .cv-wrapper {
        padding: 10px;
    }

    .cv-main-content {
        flex-direction: column;
        padding: 0;
    }

    .cv-mobile-photo-section {
        display: block !important;
        width: 100%;
        text-align: center;
        padding: 20px 0;
        background-color: #ffffff;
        order: 2;
    }

    .profile-photo-mobile {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--accent-color-1);
    }

    .cv-header {
        padding: 30px 20px;
    }

    .cv-header h1 {
        font-size: 2.5em;
    }

    .cv-content {
        order: -1;
        width: 100%;
        padding: 20px 15px;
    }

    .cv-sidebar {
        width: 100%;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 25px 15px;
        order: 0;
    }

    .qr-group {
        display: flex;
        justify-content: center;
        gap: 20px;
    }

    .single-qr-container {
        max-width: 90px;
    }
}

@media (max-width: 600px) {
    .cv-header h1 {
        font-size: 2.0em;
    }

    .cv-header .summary {
        font-size: 0.85em;
        padding: 0 5px;
    }

    .cv-sidebar h2, .cv-content h2 {
        font-size: 1.1em;
    }

    .social-links a {
        font-size: 1.4em;
    }

}

@media print {
    .theme-wrapper, .language-wrapper { display: none; }
    .cv-sidebar { width: 65mm !important; }
    .cv-content { width: 145mm !important; }
    body { background: white; }
}

.cv-header {
    padding: 10px 5px;
}

.cv-header h1 {
    font-size: 1.8em;
    letter-spacing: 1px;
}

.cv-title {
    font-size: 0.9rem;
    margin-top: 2px;
}

.cv-sidebar {
    flex: 0 0 210px;
    padding: 8px 5px; 
}

.profile-photo-desktop {
    width: 75px;
    height: 75px;
    margin-bottom: 8px;
    border-width: 2px;
}

.cv-sidebar h2 {
    font-size: 0.8rem !important; 
    margin-bottom: 4px;
}

.item-title {
    font-size: 0.88rem !important;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 2px 0;
    letter-spacing: 0.3px;
    text-transform: none;
}

.project-link {
    text-decoration: none;
}

.project-link:hover .item-title {
    color: var(--accent-color-2);
}

.cv-sidebar ul li {
    font-size: 0.72rem;
    margin-bottom: 2px;
}

.cv-sidebar section {
    margin-bottom: 8px;
}

.cv-content {
    padding: 10px 15px;
}

.cv-content h2 {
    font-size: 0.9rem; 
    margin-bottom: 4px;
    margin-top: 2px;
}

.cv-content .item {
    margin-bottom: 5px;
    padding-left: 8px;
}

.cv-content .item h3, 
.project-link h3 {
    font-size: 0.9rem; 
    margin-bottom: 1px;
}

.cv-content p, 
.cv-content ul li, 
.about-me p, 
.lang_proj1_short, 
.lang_proj2_short,
.ref-contact li {
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 2px;
}

.skill-name {
    font-size: 0.75rem;
}

/* .qr-group {
    margin-top: 5px;
    gap: 2px;
}

.single-qr-container {
    max-width: 55px;
}

.single-qr-container img {
    padding: 2px;
}

.qr-hint, .lang-view-cv-text {
    font-size: 6px;
} */

.lang-download-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
}

.ref-name {
    font-size: 0.75rem !important;
}

.ref_title_1 {
    font-size: 0.75rem !important;
}

.ref_title_2 {
    font-size: 0.75rem !important;
}

.cv-content h2 {
    font-size: 0.9rem; 
    margin-top: 20px !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.certificates .item p {
    font-size: 0.8rem;
    margin-bottom: 5px;
    line-height: 1.4;
    color: var(--text-color);
}

.cert-link {
    color: var(--light-text-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--border-color);
    transition: all 0.3s ease;
}

.cert-link:hover {
    color: var(--accent-color-2);
    border-bottom-color: var(--accent-color-2);
}

.certificates b {
    color: var(--accent-color-1);
    font-weight: 600;
    margin-right: 5px;
}

.about-me h2 {
    margin-top: 0 !important; 
    padding-top: 0 !important;
}

.cv-content h2:not(.lang-about-title) {
    margin-top: 10px !important;
    margin-bottom: 6px !important;
}

.cv-content .item {
    margin-bottom: 6px !important; 
}

.cv-wrapper {
    max-height: 300mm;
}

@media (max-width: 768px) {
    .cv-header {
        width: 100% !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 30px 15px !important;
        box-sizing: border-box !important;
    }

    body, html {
        overflow-x: hidden !important;
        width: 100%;
    }

    .cv-wrapper {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cv-mobile-photo-section {
        display: none !important;
    }

    .download-wrapper {
        bottom: 20px !important;
        right: 20px !important;
    }
}

@media (max-width: 768px) {
    .cv-content, .cv-sidebar {
        padding: 20px !important; 
        width: 100% !important;
        box-sizing: border-box !important;
        float: none !important;
    }

    .cv-wrapper {
        padding: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .about-me p, .cv-content p, .cv-content ul {
        margin-left: 5px !important;
        margin-right: 5px !important;
        text-align: left;
    }

    .cv-header h1 {
        font-size: 1.8em !important;
        word-wrap: break-word;
        padding: 0 10px;
    }
}

.theme-wrapper {
    right: 120px;
}

.theme-btn {
    padding: 8px;
    font-size: 1.1rem;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-switch-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 5px;
}

.lang-switch-btn i {
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .theme-wrapper {
        right: 110px;
        top: 15px;
    }
    .language-wrapper {
        right: 15px;
        top: 15px;
    }
    .lang-switch-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}