/**
 * Resume site styles
 * Includes responsive design, theme support and print styles
 */

:root {
    --primary-color: #2a3b4c;
    --secondary-color: #ff8c00;
    --accent-color: #ff6b35;
    --text-color: #333;
    --light-color: #f5f5f5;
    --heading-color: #2a3b4c;
    --heading-border-color: #ff8c00;
    --background-color: #f9f9f9;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        "JetBrains Mono", "Courier New", monospace; /* Changed to monospace */
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentcolor;
}

.contact-item .icon {
    flex: 0 0 auto;
}

.theme-switch .icon {
    margin-right: 0;
    width: 1.4rem;
    height: 1.4rem;
}

.icon-sun {
    display: none;
}

.dark-mode .icon-moon {
    display: none;
}

.dark-mode .icon-sun {
    display: inline-flex;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.resume-container {
    max-width: 1000px;
    margin: 2rem auto;
    background: var(--card-background);
    box-shadow: 0 5px 15px var(--shadow-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

header {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid white;
    margin-bottom: 1.5rem;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
    color: var(--accent-color);
}

.subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    min-width: 0;
    flex-shrink: 0;
}

.contact-item:hover {
    color: var(--accent-color);
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    overflow: visible;
}

.contact-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* In dark mode */
.dark-mode .contact-link {
    color: inherit;
}

.dark-mode .contact-link:hover {
    color: var(--accent-color);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 2rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section {
    margin-bottom: 2rem;
}

.section:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--heading-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--heading-border-color);
    position: relative;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.skill-name {
    display: flex;
    justify-content: space-between;
}

.skill-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--secondary-color);
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.experience-item,
.education-item {
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1.5rem;
}

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

.experience-item::after,
.education-item::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1rem;
    width: 2px;
    height: calc(100% - 1rem);
    background: #e0e0e0;
}

.experience-item:last-child::after,
.education-item:last-child::after {
    display: none;
}

.date {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.role,
.degree {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.company,
.school {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.languages-list,
.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.language-item,
.interest-item {
    background: var(--light-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: var(--transition);
}

.language-item:hover,
.interest-item:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
}

.certification-item {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--light-color);
    border-radius: 4px;
    transition: var(--transition);
}

.certification-item:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.cert-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.cert-org {
    font-style: italic;
    font-size: 0.9rem;
}

/* Repositioned theme switch button */
.theme-switch {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

    /* Light mode styling */
    background-color: #f0f0f0;
    color: #333;
}

/* Dark mode specific styling */
.dark-mode .theme-switch {
    background-color: #333;
    color: #f0f0f0;
}

.theme-switch:hover {
    transform: rotate(30deg);
}

/* Light mode - darker background on hover */
.theme-switch:hover {
    background-color: #e0e0e0;
}

/* Dark mode - lighter background on hover */
.dark-mode .theme-switch:hover {
    background-color: #444;
}

/* Print and language switch buttons */
.print-button,
.lang-switch {
    position: absolute;
    z-index: 10;
    background: var(--accent-color);
    border: none;
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.print-button {
    top: 1.5rem;
    right: 5rem;
}

/* Language switcher adjustment */
.language-switcher {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.lang-switch {
    position: static;
    background: var(--accent-color);
}

.lang-switch.active {
    background: var(--secondary-color);
    color: #1a1a1a;
}

.lang-switch:hover {
    background: var(--secondary-color);
    color: #1a1a1a;
}

.lang-icon {
    font-size: 1.2rem;
}

.print-button:focus-visible,
.lang-switch:focus-visible {
    outline: 3px solid rgba(26, 26, 26, 0.65);
    outline-offset: 2px;
}

.resume-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #eaeaea;
    color: #777;
    font-size: 12px;
}

.last-update {
    margin: 5px 0;
}

/* Hide print-only elements in normal view */
.print-only {
    display: none;
}

/* Print button and instructions section */
.print-section {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.print-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.print-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.print-btn .icon {
    width: 1.1rem;
    height: 1.1rem;
}

.print-instructions {
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* Dark mode styles for print section */
.dark-mode .print-section {
    background: var(--light-color);
}

.dark-mode .print-instructions {
    color: var(--text-color);
}

/* In dark mode */
.dark-mode .resume-footer {
    border-top-color: #333;
    color: #aaa;
}

/* Dark mode theme */
.dark-mode {
    --primary-color: #1a1a2e;
    --secondary-color: #ff8c00;
    --accent-color: #ff6b35;
    --text-color: #f5f5f5;
    --light-color: #2a2a3c;
    --heading-color: #ff8c00;
    --heading-border-color: #ff6b35;
    --background-color: #121212;
    --card-background: #1a1a2e;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

.dark-mode .language-item,
.dark-mode .interest-item {
    background: var(--light-color);
    color: #f5f5f5;
}

.dark-mode .certification-item {
    background: var(--light-color);
    color: #f5f5f5;
}

.dark-mode .theme-switch {
    background: rgba(0, 0, 0, 0.2);
}

.dark-mode .skill-bar {
    background: #2a2a3c;
}

.dark-mode .experience-item::after,
.dark-mode .education-item::after {
    background: #2a2a3c;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .header-content {
        align-items: center;
        /* Add padding-top to make space for language switcher */
        padding-top: 2rem;
    }

    .profile-pic {
        width: 120px;
        height: 120px;
    }

    h1 {
        font-size: 2rem;
    }

    .title {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .contact-info {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    /* Fix language switcher position for mobile */
    .language-switcher {
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 10;
    }

    /* Keep theme switch fixed at bottom left */
    .theme-switch {
        position: fixed;
        bottom: 1.5rem;
        left: 1.5rem;
        top: auto;
        right: auto;
    }

    .resume-container {
        margin-top: 0;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        font-size: 6.5pt;
        margin: 0;
        padding: 0;
        line-height: 1.2;
        font-family: Arial, Helvetica, sans-serif;
        width: 100%;
    }

    * {
        font-family: Arial, Helvetica, sans-serif !important;
        color: black !important;
        box-sizing: border-box !important;
    }

    .resume-container {
        box-shadow: none !important;
        margin: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }

    .theme-switch,
    .print-button,
    .language-switcher {
        display: none !important;
    }

    /* Make header even more compact */
    header {
        padding: 0.35rem !important;
        background: white !important;
        color: black !important;
        page-break-after: avoid !important;
        width: 100% !important;
        padding-bottom: 0.2rem !important; /* Reduced bottom padding */
    }

    /* Consistent layout for header regardless of device */
    .header-content {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        align-items: start !important;
        gap: 0.5rem !important;
        position: relative !important;
        width: 100% !important;
    }

    /* Add Curriculum Vitae title */
    .header-content::before {
        content: "Curriculum Vitae" !important;
        position: absolute !important;
        top: 1.9rem !important;
        left: 230px !important;
        font-size: 15pt !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5pt !important;
    }

    /* Reduce photo size significantly */
    .profile-pic {
        width: 85px !important;
        height: 85px !important;
        margin-bottom: 0 !important;
        margin-right: 0.5rem !important;
        grid-row: span 3 !important;
        border-width: 1px !important;
        box-shadow: none !important;
    }

    /* Group title elements in print layout */
    h1 {
        font-size: 12pt !important; /* Reduced from 14pt */
        margin-bottom: 0.1rem !important;
        margin-top: 0.8rem !important; /* Reduced from 1rem */
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .title {
        font-size: 9pt !important; /* Reduced from 10.5pt */
        margin-bottom: 0.05rem !important;
        grid-column: 2 !important;
        grid-row: 2 !important;
        margin-top: 0 !important;
    }

    .subtitle {
        font-size: 6.5pt !important;
        margin-bottom: 0.1rem !important;
        font-style: italic !important;
        color: #666 !important;
        line-height: 1 !important;
        margin-top: 0 !important;
        grid-column: 2 !important;
        grid-row: 3 !important;
    }

    .contact-info {
        margin-top: 0.1rem !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        width: 100% !important;
        gap: 0.8rem !important; /* Reduced spacing between contact items */
        flex-wrap: wrap !important; /* Allow wrapping if needed */
    }

    .contact-item {
        white-space: nowrap !important;
        overflow: visible !important; /* Changed from hidden to visible */
        display: flex !important;
        flex-direction: row !important; /* Icons next to text horizontally */
        align-items: center !important;
        justify-content: flex-start !important;
        flex: 0 0 auto !important;
        margin-right: 0.3rem !important; /* Reduced margin */
        font-size: 7.5pt !important; /* Base font size for the item itself */
        max-width: none !important; /* Remove any max-width constraints */
        min-width: fit-content !important;
    }

    .contact-item .icon {
        margin-right: 0.25rem !important; /* Space between icon and text */
        margin-bottom: 0 !important; /* Remove vertical margin */
        width: 9pt !important;
        height: 9pt !important;
    }

    .contact-item .icon svg {
        width: 100% !important;
        height: 100% !important;
    }

    .contact-link,
    .contact-item span,
    .contact-item a {
        font-size: 7.5pt !important; /* Make all text in contact items 7.5pt */
    }

    .contact-link {
        font-size: 7.5pt !important; /* Reduced from 8pt */
    }

    .summary,
    .typing-animation {
        margin-top: -1.15rem !important; /* Move summary higher up */
    }

    .summary p,
    .typing-animation p {
        font-size: 7.5pt !important; /* Reduced from 8pt */
        line-height: 1.3 !important;
        margin-top: 0.5rem !important;
    }

    /* Increase text size in main content */
    .experience-description p,
    .education-description p,
    .section p,
    li {
        font-size: 7.5pt !important;
    }

    /* Increase list item spacing slightly */
    li {
        margin-bottom: 0.1rem !important;
    }

    ul,
    ol {
        padding-left: 1rem !important;
        margin-bottom: 0.3rem !important;
    }

    /* Ensure consistent font size in all text elements */
    .experience-description,
    .education-description {
        font-size: 7.5pt !important;
    }

    /* Increase font size for role/company and degree/school */
    .role,
    .degree {
        font-size: 8pt !important; /* Reduced from 9pt */
        margin-bottom: 0.15rem !important;
        font-weight: bold !important;
    }

    .company,
    .school {
        font-size: 7.5pt !important; /* Reduced from 8.5pt */
        margin-bottom: 0.15rem !important;
        font-style: italic !important;
    }

    /* Increase date size slightly */
    .date {
        font-size: 7pt !important; /* Reduced from 8pt */
        margin-bottom: 0.15rem !important;
    }

    /* Increase skill name text size */
    .skill-name {
        font-size: 7.5pt !important;
    }

    /* Slightly larger language and interest items */
    .language-item,
    .interest-item {
        padding: 0.1rem 0.3rem !important;
        font-size: 7pt !important; /* Reduced from 8pt */
        background-color: white !important;
        border: 1px solid #ddd !important;
    }

    /* Compact certification items for print */
    .certification-item {
        margin-bottom: 0.2rem !important;
        padding: 0.15rem 0.25rem !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
        border-radius: 2px !important;
    }

    .cert-name {
        font-size: 7pt !important;
        font-weight: bold !important;
        margin-bottom: 0.05rem !important;
    }

    .cert-org {
        font-size: 6.5pt !important;
        font-style: italic !important;
    }

    /* Force two-column layout regardless of device */
    .main-content {
        display: grid !important;
        background-color: white !important;
        grid-template-columns: 1fr 2fr !important;
        gap: 0.4rem !important;
        padding: 0.4rem !important;
        page-break-before: avoid !important;
        width: 100% !important;
        padding-top: 0.2rem !important; /* Reduced top padding */
    }

    /* Force certifications to left column */
    .certifications-section {
        grid-column: 1 !important;
        order: 4 !important;
    }

    /* Fix content overflow */
    p,
    .experience-description,
    .education-description {
        width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Ensure sidebar sections print in correct order */
    .sidebar {
        display: flex !important;
        flex-direction: column !important;
    }

    .skills-section {
        order: 1 !important;
    }

    .languages-section {
        order: 2 !important;
    }

    .interests-section {
        order: 3 !important;
    }

    /* Minimize spacing to fit more content */
    .section {
        margin-bottom: 0.4rem !important;
        width: 100% !important;
    }

    h2 {
        font-size: 9pt !important;
        margin-bottom: 0.25rem !important;
        padding-bottom: 0.15rem !important;
        border-bottom-width: 1px !important;
    }

    p {
        margin-bottom: 0.15rem !important;
    }

    /* More compact experience and education items */
    .experience-item,
    .education-item {
        margin-bottom: 0.3rem !important;
        padding-left: 0.8rem !important;
        width: 100% !important;
    }

    .experience-item::before,
    .education-item::before {
        width: 5px !important;
        height: 5px !important;
        top: 0.4rem !important;
    }

    .experience-item::after,
    .education-item::after {
        top: 0.7rem !important;
        height: calc(100% - 0.7rem) !important;
    }

    .date {
        font-size: 7pt !important;
        margin-bottom: 0.2rem !important;
    }

    .role,
    .degree {
        margin-bottom: 0.2rem !important;
        font-weight: bold !important;
    }

    .company,
    .school {
        margin-bottom: 0.2rem !important;
        font-style: italic !important;
    }

    /* Make skills more compact */
    .skills-list {
        gap: 0.3rem !important;
        width: 100% !important;
    }

    /* Fix skill bar appearance for print */
    .skill-bar {
        height: 5px !important;
        background-color: #e9e9e9 !important;
        border-radius: 2px !important;
        overflow: hidden !important;
        border: 1px solid #ccc !important;
        position: relative !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    .skill-progress {
        height: 100% !important;
        background-color: #333 !important;
        border-radius: 2px !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }

    /* Remove the after content but preserve the percentages */
    .skill-name {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    /* Ensure skills section doesn't break */
    .skills-list,
    .skill-item {
        page-break-inside: avoid !important;
    }

    /* Smaller badges for languages and interests */
    .language-item,
    .interest-item {
        padding: 0.15rem 0.4rem !important;
        font-size: 7pt !important;
        background-color: white !important;
        border: 1px solid #ddd !important;
    }

    .languages-list,
    .interests-list {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.3rem !important;
    }

    /* Hide the last-update element in print view */
    .last-update {
        display: none !important;
    }

    /* Hide print button and show website link only in print view */
    .no-print {
        display: none !important;
    }

    .print-only {
        display: none !important;
    }

    /* Smaller footer without gray color */
    .resume-footer {
        margin-top: 3px !important;
        padding-top: 2px !important;
        font-size: 6pt !important;
        border-top-color: #000 !important;
    }

    /* Show print-only elements in print view */
    .print-only {
        display: block !important;
        font-size: 7pt !important;
        text-align: center !important;
        margin-top: 3px !important;
        color: #333 !important;
    }

    /* Set page size and margins explicitly */
    @page {
        size: letter portrait;
        margin: 0.2in;
    }

    /* Ensure no page breaks within components */
    .section,
    .experience-item,
    .education-item {
        page-break-inside: avoid !important;
    }

    /* Override any responsive mobile styles that might interfere */
    .main-content {
        grid-template-columns: 1fr 2fr !important;
    }

    .header-content {
        align-items: flex-start !important;
        padding-top: 0 !important;
    }

    /* Override any max-width constraints */
    .resume-container,
    .main-content,
    header,
    .section,
    .experience-item,
    .education-item,
    .skills-list {
        max-width: 100% !important;
    }

    /* Reduce white space */
    html,
    body {
        height: auto !important;
    }

    /* Make sure elements don't overflow their containers */
    * {
        overflow: visible !important;
    }
}

/* Add typing effect styles */
.typing-effect {
    visibility: hidden;
    opacity: 0;
}

/* Update the typing cursor styles */
.typing-cursor {
    display: inline-block;
    width: 0.5em;
    height: 1.2em; /* This will be dynamically set in JS */
    background-color: var(--accent-color);
    margin-left: 0.2em;
    animation: blink 0.7s infinite;
    position: absolute;
    vertical-align: text-bottom; /* Align properly with text */
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Add this to account for any initial hidden state during typing effect */
.typing-completed {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Typing effect styles */
.typing-animation p {
    position: relative;
}

.typing-completed p {
    visibility: visible;
    opacity: 1;
}
