:root {
    --primary-color: #0d1117;
    --secondary-color: #e1b783;
    --text-color: #c9d1d9;
    --bg-color: #0d1117;
    --border-color: #30363d;
    --link-color: #58a6ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.cv-wrapper {
    max-width: 850px;
    margin: 20px auto;
    background-color: #161b22;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cv-container {
    max-width: 850px;
    margin: 20px auto;
    padding: 40px;
    background-color: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    gap: 30px;
}

/* Single Column View Styles */
.cv-wrapper.single-column-view .cv-container {
    display: block;
    padding: 40px;
}

.cv-wrapper.single-column-view .sidebar {
    flex: none;
    /* Reset flex property */
    border-right: none;
    padding: 0;
    background: none;
}

.cv-wrapper.single-column-view .main-content {
    padding: 0;
}

.cv-wrapper.single-column-view .cv-header {
    border-bottom: 2px solid var(--border-color);
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.cv-header {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.cv-header h1 {
    margin: 0;
    font-size: 2.2em;
    color: var(--secondary-color);
    line-height: 1.2;
}

.cv-header .role {
    margin: 5px 0 0;
    font-size: 1.1em;
    font-weight: normal;
    color: var(--secondary-color);
}

.cv-header p {
    margin: 5px 0 0;
    font-size: 1.1em;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}


.contact-info a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: var(--link-color);
}

.sidebar {
    flex: 0 0 33%;
    background-color: #0d1117;
    padding: 30px 20px;
    border-right: 1px solid var(--border-color);
}

.main-content {
    flex: 1 1 67%;
    padding: 30px 20px;
}

.contact-info-sidebar {
    list-style: none;
    padding: 0;
}

.contact-info-sidebar li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.cv-item h3 a {
    color: inherit;
    text-decoration: none;
}

.cv-item h3 a:hover {
    text-decoration: underline;
}

.cv-section {
    margin-bottom: 25px;
}

.cv-section h2 {
    font-size: 1.6em;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.cv-item {
    margin-bottom: 20px;
}

.cv-item h3 {
    font-size: 1.15em;
    margin: 0;
    color: var(--text-color);
}

.cv-item .meta {
    font-size: 0.95em;
    font-style: italic;
    color: #8b949e;
    margin-bottom: 5px;
}

.cv-item p,
.cv-item ul {
    margin: 5px 0 0;
    padding-left: 18px;
}

.skills-list {
    list-style: none;
    padding: 0;
}

.skills-list li {
    margin-bottom: 10px;
}

.skills-list strong {
    color: var(--secondary-color);
    display: inline-block;
    font-size: 1.1em;
}

.controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    background-color: var(--primary-color);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.controls button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.controls .layout-toggle {
    background-color: var(--secondary-color);
    margin-right: 15px;
}

.controls .layout-toggle.active {
    background-color: var(--border-color);
    color: var(--text-color);
}

.controls button:hover {
    background-color: #c89f6c;
}

/* Print-specific styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
        padding: 0;
        margin: 0;
        line-height: 1.2;
        /* Further reduce line spacing */
    }

    .controls,
    .cv-wrapper {
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
        max-width: 100%;
        background-color: #fff;
    }

    body.printing .cv-wrapper {
        font-size: 9.5pt;
    }

    .controls,
    body.printing .controls {
        display: none !important;
    }

    /* Default to double-column print */
    body.printing .cv-container {
        display: flex;
    }

    .cv-container {
        padding: 0;
        border: none;
        gap: 12px;
        /* Reduce gap between columns */
    }

    /* Single-column print override */
    body.printing .cv-container.single-column {
        display: block;
    }

    body.printing .cv-wrapper.single-column-view .cv-container {
        padding: 15px;
    }


    .sidebar {
        background-color: #f0f0f0;
        padding: 12px;
        border-right: 1px solid #ddd;
    }

    .main-content {
        padding: 12px;
    }

    .cv-header {
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    body.printing .cv-wrapper.single-column-view .sidebar {
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .cv-section h2 {
        padding-bottom: 5px;
        margin-bottom: 10px;
    }

    .cv-section {
        margin-bottom: 12px;
        /* Reduce space between sections */
    }

    .cv-item {
        margin-bottom: 8px;
        /* Reduce space between items */
    }

    .cv-item ul {
        padding-left: 15px;
        /* Reduce list indentation */
        margin-top: 3px;
    }

    .cv-header h1,
    .cv-section h2,
    .cv-header .role,
    .cv-item h3,
    .skills-list strong {
        color: #000;
    }

    .contact-info a {
        color: #000;
        text-decoration: none;
        word-break: break-word;
        /* Allow long links to break */
    }

    .cv-item .meta {
        color: #555;
    }

    .cv-item h3 a {
        color: #000;
        text-decoration: none;
    }
}

/* --- Profile Selector Styles --- */

#profile-selector-page {
    max-width: 1600px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--secondary-color);
}

.page-header a {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
}

.page-header a:hover {
    text-decoration: underline;
}

.profile-entry {
    display: flex;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.profile-entry:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.profile-details {
    flex: 1;
    padding: 30px;
    min-width: 320px;
}

.profile-details h2 {
    font-size: 1.8rem;
    margin-top: 0;
    color: var(--secondary-color);
}

.profile-details p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.profile-details .cv-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.profile-details .cv-link:hover {
    background-color: #c89f6c;
}

.profile-preview {
    flex: 1.5;
    border-left: 1px solid var(--border-color);
}

.profile-preview iframe {
    width: 100%;
    border: none;
}

@media (max-width: 1200px) {
    .profile-entry {
        flex-direction: column;
    }
    .profile-preview {
        height: 500px; /* Give a fixed height for iframes on smaller screens */
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    .profile-details {
        min-width: unset; /* Remove min-width on smaller screens */
    }
}

@media (max-width: 767px) {
    .page-header h1 {
        font-size: 2rem;
    }
    .profile-details {
        padding: 20px;
    }
}