/* ========================================
   Sage Professional Resume Template CSS
   Inspired by Modern Business Analyst Design
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Arial', 'Helvetica Neue', 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: #748C7E;
    box-shadow: 0 0 0 3px rgba(116, 140, 126, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ========================================
   Photo Upload Section
   ======================================== */
.photo-upload-section input[type="file"] {
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
}

.photo-upload-section input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background: #748C7E;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: all 0.2s;
}

.photo-upload-section input[type="file"]::file-selector-button:hover {
    background: #5f7468;
}

/* ========================================
   Color Theme Picker
   ======================================== */
.theme-color-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #bae6fd;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-input:hover {
    transform: scale(1.05);
}

.color-label {
    flex: 1;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

.reset-color-btn {
    padding: 8px 14px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.reset-color-btn:hover {
    background: #475569;
}

/* ========================================
   Buttons
   ======================================== */
.add-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #748C7E 0%, #5f7468 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(116, 140, 126, 0.2);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(116, 140, 126, 0.3);
}

.sample-data-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 24px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.sample-data-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.remove-btn {
    padding: 8px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 8px;
}

.remove-btn:hover {
    background: #dc2626;
}

/* ========================================
   Action Buttons
   ======================================== */
.action-buttons {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

/* ========================================
   Preview Section (Right Panel)
   ======================================== */
.preview-section {
    flex: 1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 20px 32px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preview-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.btn-header-secondary,
.btn-header-success {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-header-secondary {
    background: #64748b;
    color: white;
}

.btn-header-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-header-success {
    background: #22c55e;
    color: white;
}

.btn-header-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

/* ========================================
   Preview Container
   ======================================== */
.preview-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.resume-preview {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

/* ========================================
   Resume Header (Sage Green Header)
   ======================================== */
.resume-header {
    background: #f8f9fa;
    padding: 48px 60px;
    position: relative;
    min-height: 220px;
    overflow: hidden;
}

.resume-header::before {
    content: '';
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 1057px;
    height: 417px;
    background: #748C7E;
    border-radius: 50%;
    z-index: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

/* Profile Photo */
.profile-photo-container {
    flex-shrink: 0;
}

.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    border: 6px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 48px;
    color: #cbd5e1;
}

/* Header Text */
.header-text {
    flex: 1;
    color: white;
}

.header-name {
    font-size: 56px;
    font-weight: 400;
    color: white;
    line-height: 1.1;
    margin: 0 0 12px 0;
    letter-spacing: 0.5px;
    font-family: 'Playfair Display', 'Georgia', serif;
}

.header-title {
    font-size: 28px;
    font-weight: 300;
    color: white;
    margin: 0;
    letter-spacing: 1px;
}

/* ========================================
   Resume Body (Two Columns)
   ======================================== */
.resume-body {
    display: flex;
    min-height: calc(297mm - 220px);
}

/* ========================================
   Left Sidebar (Cream/Light Sage)
   ======================================== */
.resume-sidebar {
    width: 45%;
    background: #E8EBE3;
    padding: 40px 35px;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
    text-transform: none;
    font-family: 'Georgia', serif;
}

.sidebar-text {
    font-size: 14px;
    line-height: 1.7;
    color: #4a5568;
    text-align: justify;
}

/* Experience in Sidebar */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.experience-entry {
    position: relative;
}

.exp-company {
    font-size: 15px;
    font-weight: 700;
    color: #748C7E;
    margin-bottom: 6px;
}

.exp-dates {
    font-size: 13px;
    font-style: italic;
    color: #718096;
    margin-bottom: 10px;
}

.exp-roles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exp-roles li {
    font-size: 14px;
    color: #4a5568;
    padding-left: 0;
    margin-bottom: 4px;
}

.exp-roles li::before {
    content: "• ";
    color: #748C7E;
    font-weight: bold;
    margin-right: 8px;
}

/* ========================================
   Right Main Content (White/Cream)
   ======================================== */
.resume-main {
    flex: 1;
    background: #FAFAF5;
    padding: 40px 35px;
}

.main-section {
    margin-bottom: 32px;
}

.main-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
    text-transform: none;
    font-family: 'Georgia', serif;
}

/* Education in Main Content */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.education-entry {
    position: relative;
}

.edu-institution {
    font-size: 15px;
    font-weight: 700;
    color: #748C7E;
    margin-bottom: 6px;
}

.edu-dates {
    font-size: 13px;
    font-style: italic;
    color: #718096;
    margin-bottom: 6px;
}

.edu-degree {
    font-size: 14px;
    color: #4a5568;
}

/* Skills in Main Content */
.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.skills-list li {
    font-size: 14px;
    color: #4a5568;
    padding-left: 0;
}

.skills-list li::before {
    content: "• ";
    color: #748C7E;
    font-weight: bold;
    margin-right: 8px;
}

/* Contact in Main Content */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contact-icon {
    font-size: 18px;
    color: #748C7E;
    flex-shrink: 0;
}

.contact-text {
    font-size: 14px;
    color: #4a5568;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet View */
@media (max-width: 1200px) {
    .resume-builder-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .form-section {
        width: 100%;
        max-height: 60vh;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }

    .preview-section {
        width: 100%;
        max-height: 80vh;
    }

    .resume-preview {
        width: 100%;
        max-width: 210mm;
    }
}

/* Mobile View */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow: visible !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100vh;
    }

    .resume-builder-container {
        width: 100%;
        border-radius: 8px;
        height: auto !important;
        max-height: none !important;
        min-height: auto;
    }

    .form-section {
        padding: 20px 16px;
        max-height: none !important;
        height: auto !important;
        overflow-y: visible;
    }

    .preview-section {
        max-height: none !important;
        height: auto !important;
        overflow-y: visible;
    }

    .form-section h2 {
        font-size: 22px;
    }

    .preview-container {
        padding: 16px;
    }

    /* Resume Responsive Adjustments */
    .resume-header {
        padding: 32px 24px;
        min-height: auto;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .header-name {
        font-size: 36px;
    }

    .header-title {
        font-size: 20px;
    }

    .resume-body {
        flex-direction: column;
    }

    .resume-sidebar {
        width: 100%;
        padding: 24px 20px;
    }

    .resume-main {
        width: 100%;
        padding: 24px 20px;
    }

    .sidebar-title,
    .main-title {
        font-size: 18px;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .form-section h2 {
        font-size: 20px;
    }

    .form-section-title {
        font-size: 13px;
    }

    .form-group input,
    .form-group textarea {
        font-size: 13px;
        padding: 10px 12px;
    }

    .header-name {
        font-size: 28px;
    }

    .header-title {
        font-size: 18px;
    }

    .preview-header {
        padding: 16px 20px;
    }

    .preview-header h2 {
        font-size: 18px;
    }

    .btn-header-secondary,
    .btn-header-success {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .resume-builder-container {
        box-shadow: none;
        border-radius: 0;
    }

    .form-section,
    .preview-header {
        display: none !important;
    }

    .preview-section {
        width: 100%;
        background: white;
    }

    .preview-container {
        padding: 0;
    }

    .resume-preview {
        width: 100%;
        min-height: auto;
        box-shadow: none;
        margin: 0;
    }

    .resume-body {
        page-break-inside: avoid;
    }
}

/* ========================================
   Scrollbar Styling
   ======================================== */
.form-section::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
    width: 8px;
}

.form-section::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.form-section::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.form-section::-webkit-scrollbar-thumb:hover,
.preview-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   Additional Form Item Styles
   ======================================== */
.experience-item,
.education-item,
.skill-item {
    padding: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
}

.experience-item:hover,
.education-item:hover,
.skill-item:hover {
    border-color: #748C7E;
    box-shadow: 0 2px 8px rgba(116, 140, 126, 0.1);
}
