:root {
    --primary-color: #0B0A0A;
    --accent-color: #a13017;
    --text-color: #2D2A26;
    --text-light: #686563;
    --bg-color: #FAF9F6;
    --main-bg: #FFFFFF;
    --sidebar-width: 300px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0;
}

/* Design Status Banner */
.design-status {
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    position: sticky;
    top: 0;
    z-index: 2000;
}

.cv-container {
    max-width: 1100px;
    margin: 40px auto;
    display: grid;
    grid-template-areas: 
        "header header"
        "sidebar main"
        "exp exp";
    grid-template-columns: var(--sidebar-width) 1fr;
    background: var(--main-bg);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
    min-height: 90vh;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: #F4F2EE;
    color: var(--text-color);
    padding: 2rem 1.5rem;
    border-right: 1px solid #E8E5E1;
}

.profile-photo img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--accent-color);
    padding: 5px;
    background: #fff;
}

.sidebar h2 {
    font-family: 'Newsreader', serif;
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.contact-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

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

.contact-item .icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

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

.mode-selector {
    display: flex;
    gap: 10px;
}

.mode-selector button {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-selector button.active {
    background: var(--primary-color);
    color: white;
}

.mode-selector button:hover {
    background: rgba(30, 41, 59, 0.1);
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-cloud span {
    background: rgba(161, 48, 23, 0.04);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-color);
    border: 1px solid rgba(161, 48, 23, 0.1);
    font-weight: 500;
}

.custom-list {
    list-style: none;
}

.custom-list li {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    color: var(--text-light);
    position: relative;
    padding-left: 1.2rem;
}

.custom-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 4rem;
    background: #fff;
}

.experience-print-section {
    grid-area: exp;
    padding: 2rem 4rem 4rem;
}

.cv-header {
    grid-area: header;
    padding: 2.5rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #E8E5E1;
    margin-bottom: 0;
}

.cv-header h1 {
    font-family: 'Newsreader', serif;
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.compact-section {
    margin-bottom: 2rem !important;
}

.compact-section h2 {
    font-size: 1.4rem !important;
    margin-bottom: 1rem !important;
}

.edu-item-compact {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.edu-item-compact a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(161, 48, 23, 0.2);
}

.cv-section {
    margin-bottom: 3rem;
}

.cv-section h2 {
    font-family: 'Newsreader', serif;
    font-size: 1.8rem;
    font-weight: 500;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 20px;
}

.cv-section h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E8E5E1;
}

.profile-description {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: #E8E5E1;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 6px;
    width: 9px;
    height: 9px;
    background: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.item-title {
    font-family: 'Newsreader', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.item-period {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.item-company a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(161, 48, 23, 0.2);
}

.item-details {
    font-size: 1rem;
    color: var(--text-light);
}

/* Obsolete education-grid styles removed */

/* Actions */
.actions {
    position: sticky;
    top: 40px; /* Below the banner */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E8E5E1;
    max-width: 1100px;
    margin: 0 auto;
}

.right-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 14px 24px;
    border: 1px solid #E8E5E1;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    background: #fff;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-secondary {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* Footer */
.footer {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Print Settings */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    
    @page {
        margin: 0.5cm;
    }

    .cv-container { 
        display: block !important; 
        box-shadow: none !important; 
        margin: 0 !important; 
        border: none !important; 
        width: 100% !important;
        max-width: none !important;
    }
    
    .cv-header { 
        padding: 1rem 0 !important; 
        margin-bottom: 1rem !important;
        border-bottom: 2px solid var(--primary-color) !important;
    }
    
    .cv-header h1 { font-size: 2.4rem !important; margin-bottom: 0.1rem !important; }
    
    /* Layout Logic */
    .sidebar { 
        float: left !important;
        width: 32% !important;
        background: #FAF9F6 !important; 
        padding: 0.8rem 1rem !important;
        border: none !important;
        min-height: auto !important;
    }
    
    .main-content { 
        float: right !important;
        width: 65% !important;
        padding: 0.8rem 0 0.8rem 1.5rem !important;
        border: none !important;
    }

    .experience-print-section {
        clear: both !important;
        width: 100% !important;
        float: none !important;
        padding: 1rem 0 !important;
    }

    /* SHORT MODE - FORCED 2 PAGES */
    body.cv-mode-short .cv-section { 
        margin-bottom: 0.8rem !important; 
    }
    body.cv-mode-short .cv-section h2 { 
        font-size: 1.2rem !important; 
        margin-bottom: 0.4rem !important; 
    }
    body.cv-mode-short .profile-description { 
        font-size: 0.85rem !important; 
        line-height: 1.3 !important; 
    }
    body.cv-mode-short .sidebar-section {
        margin-bottom: 0.8rem !important;
    }
    body.cv-mode-short .skill-tag, body.cv-mode-short .lang-item, body.cv-mode-short .edu-item-compact {
        font-size: 0.8rem !important;
        padding: 2px 0 !important;
        margin: 0 !important;
    }
    
    body.cv-mode-short .skills-grid {
        gap: 15px !important;
        margin-bottom: 0.5rem !important;
    }

    /* Force Experience to Page 2 in Short Mode */
    body.cv-mode-short .experience-print-section {
        clear: both !important;
        width: 100% !important;
        float: none !important;
        padding-top: 0.2rem !important;
        break-before: page !important;
        page-break-before: always !important;
    }
    
    body.cv-mode-short .timeline::before,
    body.cv-mode-short .timeline-item::before {
        display: none !important;
    }

    body.cv-mode-short .timeline {
        padding-left: 0 !important;
    }

    body.cv-mode-short .experience-print-section .timeline-item { 
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: baseline !important;
        gap: 10px !important;
        margin-bottom: 2px !important; 
        padding-bottom: 2px !important;
        font-size: 0.75rem !important;
        border-bottom: 1px dotted #eee !important;
    }

    body.cv-mode-short .experience-print-section .item-header {
        display: contents !important;
    }

    body.cv-mode-short .experience-print-section .item-title {
        font-weight: 700 !important;
        width: 40% !important; /* Slightly less for title */
        font-size: 0.7rem !important; /* Reduced font size as requested */
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.cv-mode-short .experience-print-section .item-period {
        color: var(--accent-color) !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        font-size: 0.6rem !important;
        text-align: right !important;
        min-width: 80px !important;
        flex-shrink: 0 !important;
    }

    body.cv-mode-short .experience-print-section .item-company {
        font-style: italic !important;
        color: var(--text-color) !important;
        margin: 0 !important;
        flex: 1 !important;
        font-size: 0.7rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    body.cv-mode-short .item-details {
        display: none !important;
    }

    /* FULL MODE - ALLOWS DETAILS AND MORE PAGES */
    body:not(.cv-mode-short) .experience-print-section {
        break-before: auto !important;
        page-break-before: auto !important;
    }
    body:not(.cv-mode-short) .item-details {
        display: block !important;
        font-size: 0.9rem;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .cv-container { flex-direction: column; margin: 0; border-radius: 0; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #E8E5E1; }
    .main-content { padding: 2rem; }
    .cv-header h1 { font-size: 2.5rem; }
}
