/* ========================================
   Professional Dark Resume Template CSS
   Based on Korina Villanueva Design
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Main Container
   ======================================== */
.resume-builder-container {
    max-width: 1400px;
    width: 95vw;
    height: 92vh;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ========================================
   Form Section (Left Panel)
   ======================================== */
.form-section {
    width: 450px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    padding: 32px 28px;
    overflow-y: auto;
    border-right: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.form-section h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
    margin-top: 28px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Form Groups & Inputs
   ======================================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
}

/* ========================================
   Color Picker
   ======================================== */
.theme-color-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.theme-color-section label {
    color: white !important;
    font-size: 14px;
    margin-bottom: 12px;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.color-input {
    width: 50px;
    height: 40px;
    border: 3px solid white;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-input:hover {
    transform: scale(1.05);
}

.color-label {
    flex: 1;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.reset-color-btn {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-color-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* ========================================
   Photo Upload
   ======================================== */
.photo-upload-section {
    background: #f8fafc;
    padding: 18px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    margin-bottom: 24px;
}

.photo-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.photo-input {
    display: none;
}

.photo-upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.photo-upload-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.photo-filename {
    flex: 1;
    font-size: 13px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Buttons
   ======================================== */
.add-btn,
.remove-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.add-btn {
    background: #10b981;
    color: white;
}

.add-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.remove-btn {
    background: #ef4444;
    color: white;
    margin-top: 8px;
}

.remove-btn:hover {
    background: #dc2626;
}

/* ========================================
   Form Actions
   ======================================== */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.btn-load-sample {
    flex: 1;
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-sample:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* ========================================
   Education, Experience, Skills Items
   ======================================== */
.education-item,
.experience-item,
.skill-item {
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 2px solid #e2e8f0;
}

/* ========================================
   Preview Section (Right Panel)
   ======================================== */
.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: white;
    border-bottom: 2px solid #e2e8f0;
}

.preview-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 10px;
}

.btn-header-secondary,
.btn-header-success {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header-secondary {
    background: #f1f5f9;
    color: #475569;
}

.btn-header-secondary:hover {
    background: #e2e8f0;
}

.btn-header-success {
    background: #10b981;
    color: white;
}

.btn-header-success:hover {
    background: #059669;
}

/* ========================================
   Resume Preview Container
   ======================================== */
.resume-preview {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.resume-template {
    width: 210mm;
    min-height: 297mm; /* A4 page height */
    height: fit-content;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Resume Header - Dark Background
   ======================================== */
.resume-header {
    background: #2d3748;
    padding: 48px 56px;
    color: white;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-photo-container {
    flex-shrink: 0;
}

.header-photo,
.header-photo-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.2);
}

.header-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

.header-text {
    flex: 1;
}

.header-name {
    font-size: 52px;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    line-height: 1.1;
    letter-spacing: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

.header-title {
    font-size: 20px;
    font-weight: 400;
    color: #3b82f6;
    margin: 0;
    letter-spacing: 1px;
    font-family: Arial, Helvetica, sans-serif;
}

/* ========================================
   Resume Body - Two Columns
   ======================================== */
.resume-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    min-height: calc(297mm - 180px); /* A4 height minus header */
    flex: 1;
}

/* ========================================
   Left Column (Contact, Education, Skills)
   ======================================== */
.resume-left-column {
    background: #f7fafc;
    padding: 42px 32px;
    border-right: 1px solid #e2e8f0;
    min-height: 100%;
    position: relative;
}

/* Extend sidebar background for multi-page content */
.resume-left-column::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 2000px; /* Extended height for additional pages */
    background: #f7fafc;
    border-right: 1px solid #e2e8f0;
}

.resume-section {
    margin-bottom: 32px;
}

.resume-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
    font-family: Arial, Helvetica, sans-serif;
}

/* Contact Items */
.contact-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #2d3748;
    line-height: 1.6;
    font-family: Arial, Helvetica, sans-serif;
}

.contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #3b82f6;
    margin-top: 2px;
}

/* Education List */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.education-entry {
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.education-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.education-degree {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
    font-family: Arial, Helvetica, sans-serif;
}

.education-institution {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 2px;
    font-family: Arial, Helvetica, sans-serif;
}

.education-year {
    font-size: 12px;
    color: #718096;
    font-family: Arial, Helvetica, sans-serif;
}

/* Skills List */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-entry {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skill-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    font-family: Arial, Helvetica, sans-serif;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* ========================================
   Right Column (Profile, Experience)
   ======================================== */
.resume-right-column {
    background: white;
    padding: 42px 48px 0 48px;
}

/* Profile Text */
.profile-text {
    font-size: 14px;
    line-height: 1.8;
    color: #2d3748;
    text-align: justify;
    font-family: Arial, Helvetica, sans-serif;
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.experience-entry {
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.experience-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.experience-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    font-family: Arial, Helvetica, sans-serif;
}

.experience-company {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    margin-bottom: 4px;
    font-family: Arial, Helvetica, sans-serif;
}

.experience-year {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
    white-space: nowrap;
    font-family: Arial, Helvetica, sans-serif;
}

.experience-description {
    font-size: 13px;
    line-height: 1.7;
    color: #4a5568;
    margin-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.experience-description ul {
    margin: 0;
    padding-left: 20px;
}

.experience-description li {
    margin-bottom: 6px;
}

/* ========================================
   Scrollbar Styling
   ======================================== */
.form-section::-webkit-scrollbar,
.resume-preview::-webkit-scrollbar {
    width: 8px;
}

.form-section::-webkit-scrollbar-track,
.resume-preview::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.form-section::-webkit-scrollbar-thumb,
.resume-preview::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.form-section::-webkit-scrollbar-thumb:hover,
.resume-preview::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Responsive Design - Tablets
   ======================================== */
@media (max-width: 1200px) {
    .resume-builder-container {
        width: 98vw;
        height: 95vh;
    }

    .form-section {
        width: 400px;
        padding: 24px 20px;
    }

    .resume-template {
        width: 190mm;
        min-height: 270mm;
    }

    .resume-body {
        grid-template-columns: 280px 1fr;
        min-height: calc(270mm - 160px);
    }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media (max-width: 968px) {
    body {
        padding: 10px;
        overflow: auto;
    }

    .resume-builder-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 8px;
    }

    .form-section {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding: 24px 16px;
        max-height: none;
        overflow-y: visible;
    }

    .form-section h2 {
        font-size: 22px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .preview-section {
        width: 100%;
    }

    .preview-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .preview-header h2 {
        font-size: 18px;
        width: 100%;
    }

    .preview-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-header-secondary,
    .btn-header-success {
        width: 100%;
    }

    .resume-preview {
        padding: 16px;
    }

    .resume-template {
        width: 100%;
        min-height: auto;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .resume-header {
        padding: 32px 24px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .header-photo,
    .header-photo-placeholder {
        width: 100px;
        height: 100px;
    }

    .header-name {
        font-size: 32px;
    }

    .header-title {
        font-size: 18px;
    }

    .resume-body {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .resume-left-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 28px 24px;
        min-height: auto;
    }

    .resume-left-column::after {
        display: none;
    }

    .resume-right-column {
        padding: 28px 24px;
    }

    .section-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 20px 12px;
    }

    .resume-header {
        padding: 24px 16px;
    }

    .header-name {
        font-size: 26px;
    }

    .header-title {
        font-size: 16px;
    }

    .header-photo,
    .header-photo-placeholder {
        width: 80px;
        height: 80px;
    }

    .resume-left-column,
    .resume-right-column {
        padding: 20px 16px;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .color-input {
        width: 100%;
    }

    .reset-color-btn {
        width: 100%;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .resume-builder-container {
        box-shadow: none;
        border-radius: 0;
        height: auto;
    }

    .form-section,
    .preview-header {
        display: none !important;
    }

    .preview-section {
        background: white;
    }

    .resume-preview {
        padding: 0;
    }

    .resume-template {
        box-shadow: none;
        width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }

    .resume-body {
        min-height: calc(100vh - 180px);
    }

    .resume-left-column {
        min-height: 100%;
    }

    .resume-left-column::after {
        height: 9999px; /* Ensure sidebar extends on all pages */
    }
}
