/* ===========================
   CV Project - Main Styles
   ========================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===========================
   CSS Custom Properties
   ========================== */
:root {
    --dark-bg: #2d2d2d;
    --light-bg: #f5f5f5;
    --accent-color: #ff9800;
    --text-light: #e0e0e0;
    --text-dark: #333333;
    --section-gap: 1.5rem;
    --border-radius: 8px;
    --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* ===========================
   Base Styles
   ========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

/* ===========================
   Typography
   ========================== */
a {
    color: white;
    text-decoration: none;
}

a:hover {
    color: #f97316;
    text-decoration: underline;
}

/* ===========================
   CV Container
   ========================== */
.cv-container {
    background-color: white;
    width: 1100px;
    max-width: 100%;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    position: relative;
}

/* ===========================
   Download Button
   ========================== */
.download-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background-color: #e08600;
}

.download-icon {
    color: white;
    font-size: 1.2rem;
}

/* ===========================
   Sidebar Styles
   ========================== */
.sidebar {
    width: 280px;
    background-color: var(--dark-bg);
    color: var(--text-light);
    padding: 1.8rem 1.2rem;
}

/* Profile Header */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.name {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    text-align: center;
}

.title {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.9;
    text-align: center;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 1.2rem;
}

.section-title {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    position: relative;
    padding-bottom: 0.5rem;
    color: var(--accent-color);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 35px;
    height: 2px;
    background-color: var(--accent-color);
}

/* Contact Section */
.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.7rem;
    font-size: 0.85rem;
}

.contact-icon {
    margin-right: 0.8rem;
    color: var(--accent-color);
    font-size: 1rem;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    font-size: 1rem;
    transition: transform 0.3s, background-color 0.3s;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-3px);
    background-color: var(--accent-color);
    color: white;
}

/* Profile Text */
.profile-text {
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* Key Competencies */
.key-competence {
    display: flex;
    margin-bottom: 0.4rem;
    align-items: flex-start;
}

.competence-icon {
    margin-right: 0.6rem;
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.competence-text {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* DevOps Section */
.devops-container {
    margin-top: 0.6rem;
}

.devops-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.devops-item {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
}

.devops-icon {
    margin-right: 0.4rem;
    font-size: 0.8rem;
}

.growth-area {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.growth-icon {
    margin-right: 0.6rem;
    color: var(--accent-color);
}

/* Skills Container */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Languages */
.languages-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.language-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.language-name {
    font-size: 0.85rem;
}

.language-level {
    width: 100px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.language-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--accent-color);
}

/* Interests */
.interests-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.interest-item {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.interest-icon {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

/* ===========================
   Main Content Styles
   ========================== */
.main-content {
    flex: 1;
    padding: 1.8rem 1.5rem;
    background-color: white;
}

.main-section-title {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 0.5rem;
}

.main-section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

/* ===========================
   Timeline Styles
   ========================== */
.timeline-section {
    margin-bottom: 2rem;
}

.timeline {
    position: relative;
    padding-bottom: 0.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--accent-color);
    transform: translateX(-50%);
}

.timeline-row {
    display: flex;
    margin-bottom: 0.8rem;
}

.timeline-left,
.timeline-right {
    position: relative;
    width: 50%;
    z-index: 1;
}

.timeline-right {
    margin-top: 1.5rem;
}

.timeline-left .timeline-content {
    margin-right: 15px;
    position: relative;
}

.timeline-right .timeline-content {
    margin-left: 15px;
    position: relative;
}

.timeline-content {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 0.8rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.timeline-left .timeline-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 15px;
    border-style: solid;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #f8f9fa;
}

.timeline-right .timeline-content::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 15px;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #f8f9fa transparent transparent;
}

.timeline-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-color);
    top: 16px;
    z-index: 2;
}

.timeline-left .timeline-dot {
    right: -7px;
}

.timeline-right .timeline-dot {
    left: -7px;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-dark);
}

.timeline-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--accent-color);
}

.timeline-year {
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0.6rem;
    color: #666;
    display: block;
}

.timeline-text {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #555;
}

/* Enhanced formatting for additional roles */
.timeline-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

.timeline-text br + strong {
    margin-top: 0.5rem;
    display: inline-block;
}

/* ===========================
   Grid Sections
   ========================== */
.grid-section {
    margin-bottom: 1.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.project-card {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 0.1rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.project-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    color: var(--text-dark);
    padding: 0.4rem 0.4rem 0 0.4rem;
}

.project-subtitle {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.3rem;
    padding: 0 0.4rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-bottom: 0.3rem;
    padding: 0 0.4rem;
}

.tech-tag {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.55rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0 0.4rem 0.4rem 0.4rem;
}

.project-link i {
    margin-right: 0.3rem;
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.certificate-item {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 0.5rem 0.7rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s;
}

.certificate-item:hover {
    transform: translateY(-2px);
}

.certificate-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.certificate-link {
    color: var(--accent-color);
    font-size: 0.65rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.4rem;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.certificate-link:hover {
    background-color: rgba(255, 152, 0, 0.2);
}

.certificate-link i {
    margin-right: 0.3rem;
}

/* ===========================
   Loading Overlay
   ========================== */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#loadingOverlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

#cv-competencies{
    margin-top: 0.6rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Responsive Design
   ========================== */
@media (max-width: 1000px) {
    .cv-container {
        flex-direction: column;
        width: 100%;
    }

    .sidebar {
        width: 100%;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-row {
        flex-direction: column;
    }

    .timeline-left,
    .timeline-right {
        width: 100%;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    .timeline-left .timeline-content,
    .timeline-right .timeline-content {
        margin-left: 40px;
        margin-right: 0;
    }

    .timeline-left .timeline-dot,
    .timeline-right .timeline-dot {
        left: 13px;
        right: auto;
    }

    .timeline-left .timeline-content::after,
    .timeline-right .timeline-content::after {
        display: none;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .certificates-grid {
        grid-template-columns: 1fr;
    }

    .download-btn {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Print Styles for PDF
   ========================== */
@media print {
    body {
        background-color: white;
        padding: 0;
        margin: 0;
        font-size: 95%;
    }

    .cv-container {
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        overflow: visible;
        page-break-inside: avoid;
    }

    .sidebar {
        width: 28%;
        padding: 1.5rem 1rem;
    }

    .main-content {
        width: 72%;
        padding: 1.5rem 1.2rem;
    }

    .download-btn {
        display: none;
    }

    .section-gap {
        margin-bottom: 1rem;
    }

    .sidebar-section {
        margin-bottom: 1rem;
    }

    .timeline-section,
    .grid-section {
        margin-bottom: 1.2rem;
    }

    .timeline-row {
        margin-bottom: 0.5rem;
    }

    .timeline-right {
        margin-top: 1rem;
    }

    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        page-break-inside: avoid;
    }

    .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        page-break-inside: avoid;
    }

    .project-card,
    .certificate-item,
    .timeline-content {
        page-break-inside: avoid;
    }

    .experience-section {
        page-break-after: always;
    }

    h2 {
        page-break-after: avoid;
    }
}
