/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a237e;
    --secondary-color: #00bcd4;
    --accent-color: #ff6f00;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--bg-light);
    font-size: 14px;
}

/* Main Container */
.cv-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: var(--shadow);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.cv-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
}

.header-content {
    max-width: 100%;
}

.profile-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: center;
}

.profile-image-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

.image-decoration {
    position: absolute;
    top: -10px;
    left: -10px;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

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

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.name {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    height: 35px;
}

.typing-text {
    color: var(--accent-color);
    font-weight: 600;
}

.summary {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.contact-item i {
    color: var(--accent-color);
    width: 16px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #e65100;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Main Content */
.cv-main {
    flex: 1;
    padding: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    height: 100%;
}

/* Sections */
.cv-section {
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.section-title {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--secondary-color);
    font-size: 1rem;
}

/* Skills Section */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.skill-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

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

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 3px;
    width: 0;
    transition: width 1s ease-in-out;
}

.skill-percentage {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 600;
    align-self: flex-end;
}

/* Competencies Section */
.competencies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.competency-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 500;
}

.competency-item i {
    color: var(--secondary-color);
    font-size: 0.9rem;
    width: 16px;
}

/* Education Section */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.education-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.education-year {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.education-details h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.2rem;
}

.education-details p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Experience Section */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.experience-item {
    border-left: 3px solid var(--secondary-color);
    padding-left: 1rem;
    position: relative;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--secondary-color);
    border-radius: 50%;
}

.experience-header {
    margin-bottom: 0.8rem;
}

.experience-header h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.company {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
    display: block;
    margin-bottom: 0.2rem;
}

.duration {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

.responsibilities {
    list-style: none;
    padding-left: 0;
}

.responsibilities li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

.responsibilities li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 0.7rem;
}

/* Educational Software Development Section */
.software-development-section {
    padding: 2rem;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    text-align: center; /* Center the title and description */
    max-width: 100%; /* Ensure it takes full width of its parent */
    margin-left: auto;
    margin-right: auto;
}

.software-development-section .section-title {
    justify-content: center; /* Center the icon and title */
}

.software-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the cards horizontally */
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: fit-content; /* Make the grid fit its content */
    margin-left: auto; /* Center the grid itself */
    margin-right: auto;
}

.software-card {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1 1 200px; /* Allow cards to grow and shrink, with a base of 200px */
    max-width: 250px; /* Limit max width for better appearance in a row */
    transition: transform 0.3s ease;
}

.software-card:hover {
    transform: translateY(-5px);
}

.software-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.software-card h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.software-card p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Portfolio Section */
.portfolio-section {
    padding: 2rem;
    background: var(--bg-white);
    box-shadow: var(--shadow);
}

.portfolio-section .section-title {
    justify-content: center;
}

.portfolio-section .section-description {
    text-align: center;
    margin-bottom: 1.5rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    justify-content: center; /* Center items in the grid */
    max-width: 1000px; /* Limit width for better centering */
    margin: 0 auto; /* Center the grid itself */
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

/* Lightbox Styles */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block; /* Ensure it's a block element for margin auto to work */
    margin: auto; /* Center the image */
}

.lightbox .close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox .close-btn:hover,
.lightbox .close-btn:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox .prev-btn,
.lightbox .next-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox .prev-btn {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox .next-btn {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox .prev-btn:hover,
.lightbox .next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Footer */
.cv-footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-image-container {
        margin-bottom: 1rem;
    }

    .contact-info {
        justify-content: center;
    }

    .action-buttons {
        justify-content: center;
    }

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

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

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

    .software-cards-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .software-card {
        max-width: 100%;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Print Styles */
@media print {
    body {
        background: none;
        font-size: 12pt;
        color: black;
    }

    .cv-container {
        max-width: 100%;
        box-shadow: none;
        margin: 0;
        padding: 0;
        display: block; /* Allow normal flow for printing */
    }

    .cv-header {
        background: none !important;
        color: black !important;
        padding: 1rem;
        text-align: center;
    }

    .profile-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .profile-image-container {
        display: none; /* Hide image for print */
    }

    .profile-info {
        align-items: center;
    }

    .name,
    .title,
    .summary {
        color: black !important;
    }

    .contact-info {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons {
        display: none; /* Hide buttons for print */
    }

    .cv-main {
        padding: 0.5rem;
        display: block; /* Allow normal flow for printing */
    }

    .content-grid {
        display: block; /* Stack columns for print */
    }

    .cv-section {
        margin-bottom: 0.5rem;
        box-shadow: none;
        border: 1px solid #eee;
        padding: 0.8rem;
        page-break-inside: avoid; /* Prevent breaking inside sections */
    }

    .section-title {
        color: var(--primary-color);
        font-size: 14pt;
        margin-bottom: 0.5rem;
        justify-content: flex-start;
    }

    .section-title i {
        color: var(--secondary-color);
    }

    .skills-list,
    .competencies-grid,
    .education-list,
    .stats-grid,
    .experience-list,
    .software-cards-grid,
    .portfolio-grid {
        display: block; /* Stack items for print */
    }

    .skill-item,
    .competency-item,
    .education-item,
    .stat-item,
    .experience-item,
    .software-card,
    .portfolio-item {
        margin-bottom: 0.3rem;
        padding: 0;
        background: none;
        box-shadow: none;
        border-radius: 0;
    }

    .experience-item {
        border-left: none;
        padding-left: 0;
    }

    .experience-item::before {
        display: none;
    }

    .responsibilities li {
        font-size: 10pt;
        margin-bottom: 0.1rem;
    }

    .software-card {
        max-width: 100%;
        text-align: left;
    }

    .software-card i {
        display: none;
    }

    .portfolio-item img {
        height: auto;
        max-width: 100%;
    }

    .lightbox {
        display: none !important; /* Hide lightbox and footer in print */
    }

    /* Ensure content flows across pages */
    .cv-section {
        page-break-inside: avoid;
    }

    /* Prevent header from repeating on every page */
    .cv-header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
    }
}

/* Show lightbox only when open */
.lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}


