/* Base Styles - Portfolio Theme */
:root {
    --bg-color: #1f242d;
    --second-bg-color: #323946;
    --text-color: #fff;
    --main-color: #0ef;
    --accent-color: #0af;
    --card-bg: #2a303c;
    --muted: #b0b8c5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.cv-container {
    max-width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 238, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* CV Content */
.cv-content {
    padding: 40px;
}

/* Header Section with Profile Picture */
.cv-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--main-color);
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--main-color);
    padding: 4px;
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    box-shadow: 0 0 20px var(--main-color);
    overflow: hidden;
    position: relative;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: var(--second-bg-color);
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--second-bg-color);
    color: var(--muted);
    text-align: center;
    padding: 10px;
}

.profile-placeholder i {
    font-size: 40px;
    margin-bottom: 8px;
    color: var(--main-color);
}

.profile-placeholder span {
    font-size: 14px;
    line-height: 1.4;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 32px;
    background: linear-gradient(45deg, var(--main-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    font-weight: 600;
}

.header-text .subtitle {
    font-size: 18px;
    color: var(--muted);
    font-weight: 400;
}

/* Layout */
.cv-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Section Styling */
.section {
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--main-color);
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 238, 255, 0.2);
}

.section-title {
    font-size: 20px;
    color: var(--main-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.section-title i {
    font-size: 24px;
}

/* Experience Items */
.experience-item,
.education-item {
    margin-bottom: 20px;
}

.job-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.company,
.institution {
    font-size: 15px;
    color: var(--main-color);
    font-weight: 500;
    margin-bottom: 3px;
}

.date-location {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 10px;
    font-style: italic;
}

ul {
    padding-left: 20px;
    margin: 10px 0;
}

li {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 14px;
}

li strong {
    color: var(--text-color);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.skill-name {
    font-weight: 500;
    color: var(--text-color);
}

.skill-level {
    color: var(--muted);
    font-size: 14px;
}

/* Skills Table Styling */
.skills-table {
    margin-top: 10px;
}

.skills-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.skills-table th,
.skills-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 238, 255, 0.2);
}

.skills-table th {
    background: rgba(0, 238, 255, 0.1);
    font-weight: 600;
    color: var(--main-color);
    font-size: 14px;
}

.skills-table td {
    color: var(--text-color);
    font-size: 14px;
}

.skill-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.skill-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--main-color), var(--accent-color));
    box-shadow: 0 0 8px var(--main-color);
    transition: width 1.5s ease-in-out;
}

/* Print styles for skills table */
@media print {
    .skills-table th {
        background: #f0f8ff !important;
        color: #2c5aa0 !important;
    }

    .skills-table th,
    .skills-table td {
        border-bottom: 1px solid #e0e0e0 !important;
    }

    .skill-bar {
        background: #e0e0e0 !important;
        box-shadow: none !important;
    }

    .skill-fill {
        background: #2c5aa0 !important;
        box-shadow: none !important;
    }
}

/* Sidebar */
.sidebar {
    background: var(--second-bg-color);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.contact-info p {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info i {
    color: var(--main-color);
    font-size: 18px;
    width: 20px;
}

.contact-info strong {
    color: var(--text-color);
}

/* Download Button at Bottom */
.download-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--main-color);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: var(--main-color);
    color: var(--bg-color);
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--main-color);
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--main-color);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--second-bg-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--main-color);
    margin-right: 15px;
}

.back-btn:hover {
    background: var(--main-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

/* Loading overlay for PDF generation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: var(--main-color);
    font-size: 20px;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top: 3px solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Print Styles for PDF - Clean White Theme */
@media print {
    :root {
        --bg-color: #ffffff;
        --text-color: #333333;
        --main-color: #2c5aa0;
        --muted: #666666;
    }

    body {
        background: white !important;
        color: #333 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cv-container {
        max-width: 100% !important;
        min-height: 100vh !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        border: none !important;
        background: white !important;
    }

    .cv-content {
        padding: 30px !important;
    }

    /* Remove interactive elements */
    .download-section {
        display: none !important;
    }

    /* Profile picture styling for print */
    .profile-picture {
        border: 2px solid #2c5aa0 !important;
        background: white !important;
        box-shadow: none !important;
    }

    .profile-picture img {
        background: #f8f9fa !important;
    }

    .profile-placeholder {
        background: #f8f9fa !important;
        color: #666 !important;
    }

    .profile-placeholder i {
        color: #2c5aa0 !important;
    }

    /* Clean white theme for print */
    .section {
        background: white !important;
        border-left: 4px solid #2c5aa0 !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .sidebar {
        background: #f8f9fa !important;
        box-shadow: none !important;
    }

    .section-title {
        color: #2c5aa0 !important;
    }

    .header-text h1 {
        background: none !important;
        color: #2c5aa0 !important;
        -webkit-text-fill-color: #2c5aa0 !important;
    }

    .header-text .subtitle {
        color: #666 !important;
    }

    .company,
    .institution {
        color: #2c5aa0 !important;
    }

    .job-title {
        color: #333 !important;
    }

    li {
        color: #666 !important;
    }

    li strong {
        color: #333 !important;
    }

    .contact-info p {
        color: #666 !important;
    }

    .contact-info strong {
        color: #333 !important;
    }

    .contact-info i {
        color: #2c5aa0 !important;
    }

    /* Ensure good page breaks */
    .section {
        page-break-inside: avoid;
    }

    .experience-item,
    .education-item {
        page-break-inside: avoid;
    }

    /* Hide decorative elements that don't print well */
    .section:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cv-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-picture {
        width: 120px;
        height: 120px;
    }

    .cv-layout {
        grid-template-columns: 1fr;
    }

    .cv-content {
        padding: 20px;
    }

    .header-text h1 {
        font-size: 24px;
    }

    .header-text .subtitle {
        font-size: 14px;
    }

    .section-title {
        font-size: 18px;
    }

    .download-section {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .back-btn {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .cv-content {
        padding: 15px;
    }

    .section {
        padding: 15px;
    }

    .sidebar {
        padding: 20px;
    }

    .profile-picture {
        width: 100px;
        height: 100px;
    }
}

/* Animation for sections */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: slideIn 0.5s ease-out;
}