@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&display=swap');

:root {
    --primary: #2c3e50;
    --bg-app: #f4f7f6;
    --bg-sidebar: #ffffff;
    --border: #d1d5db;
    --cv-text: #000000;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: #333;
    overflow: hidden;
}

/* --- App Layout --- */
.app-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 30px;
    overflow-y: auto;
    z-index: 10;
}

.sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--primary);
    text-align: center;
    font-weight: 800;
}

.section-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6b7280;
    margin: 25px 0 10px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 5px;
}

.input-group { margin-bottom: 15px; }
.input-group label { display: block; margin-bottom: 5px; font-size: 0.8rem; font-weight: 600; }
.input-group input, .input-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn-add {
    width: 100%;
    padding: 8px;
    background: #f9fafb;
    border: 1px dashed var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* --- Preview Area --- */
.preview-area {
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    background: #e5e7eb;
}

/* --- THE EXACT TEMPLATE (CV Paper) --- */
.cv-paper {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 20mm;
    font-family: 'Crimson Pro', serif; /* Serif font like the image */
    color: var(--cv-text);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

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

.cv-header h1 {
    font-size: 24pt;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cv-header p {
    font-size: 11pt;
    margin-bottom: 5px;
}

/* --- Section Headers --- */
.cv-section-title {
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12pt;
    margin: 15px 0 5px;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 2px 0;
}

.cv-summary {
    font-size: 10.5pt;
    text-align: justify;
    line-height: 1.4;
    padding: 5px 0;
}

/* --- Experience & Education Item --- */
.cv-item {
    margin-bottom: 10px;
}

.cv-item-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 11pt;
}

.cv-item-sub {
    font-size: 10.5pt;
    margin-bottom: 3px;
}

.cv-item-list {
    margin-left: 20px;
    font-size: 10.5pt;
}

.cv-item-list li {
    margin-bottom: 2px;
}

/* --- Skills 3-Column Grid --- */
.skills-grid {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 10.5pt;
}

.skills-grid ul {
    list-style-type: disc;
    margin-left: 20px;
    width: 30%; /* Force 3 columns in flex */
}

/* --- Export Button --- */
.export-bar {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.btn-primary {
    background: #000;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

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

@media print {
    /* Hide everything on the page */
    body > * {
        display: none !important;
    }
    
    /* Show only the CV paper and ensure it takes full page */
    #cv-paper, #cv-paper * {
        display: block !important;
        visibility: visible !important;
    }
    
    #cv-paper {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        min-height: 297mm;
        padding: 15mm; /* Standard margin */
        margin: 0;
        box-shadow: none;
        border: none;
    }

    .export-btn, .sidebar {
        display: none !important;
    }

    /* Fix for 3-column skills in print */
    .skills-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
