/* ATS CV Builder Styles */

.editor-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.editor-section:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.editor-section.editing {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.cv-preview {
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: 'Times New Roman', serif;
    line-height: 1.4;
    margin: 0;
    padding: 16px;
    border: 1px solid #e0e0e0;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    user-select: text;
    cursor: text;
}

.cv-preview::selection {
    background-color: #3b82f6;
    color: white;
}

.ats-score {
    background: linear-gradient(135deg, #10b981, #059669);
}

.keyword-highlight {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
}

.section-editor {
    min-height: 120px;
    resize: vertical;
}

.section-content {
    transition: all 0.3s ease;
}

.section-content.hidden {
    display: none;
}

/* Pagination styles for preview */
.cv-page {
    width: 100%;
    min-height: 100%;
    padding: 8px;
    margin: 0;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    page-break-after: always;
}

.cv-page:last-child {
    page-break-after: avoid;
}

/* Rich Text Formatting Toolbar */
.formatting-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.format-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.format-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.format-textarea {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
}

/* Bullet List Styles - Ensure bullet lists display correctly in preview */
#cvPreview ul, 
#mobileCvPreview ul,
.cv-page ul {
    list-style-type: disc !important;
    margin: 8px 0 !important;
    padding-left: 20px !important;
    display: block !important;
}

#cvPreview li, 
#mobileCvPreview li,
.cv-page li {
    display: list-item !important;
    margin-bottom: 4px !important;
    margin-left: 0 !important;
}

/* FORCE bullet list display - override everything */
* ul {
    list-style-type: disc !important;
    padding-left: 20px !important;
    margin: 8px 0 !important;
    display: block !important;
}

* li {
    display: list-item !important;
    margin-bottom: 4px !important;
    list-style-type: disc !important;
    margin-left: 0 !important;
}

/* Specific targeting for all preview containers */
#cvPreview ul,
#mobileCvPreview ul,
.cv-page ul,
div[id*="Preview"] ul,
.cv-content ul,
.experience-item ul {
    list-style-type: disc !important;
    padding-left: 20px !important;
    margin: 8px 0 !important;
    display: block !important;
}

#cvPreview li,
#mobileCvPreview li,
.cv-page li,
div[id*="Preview"] li,
.cv-content li,
.experience-item li {
    display: list-item !important;
    margin-bottom: 4px !important;
    list-style-type: disc !important;
    margin-left: 0 !important;
}

/* Layout Overrides */
/* REMOVE ALL CONFLICTING STYLES AND FORCE LAYOUT */
* {
    box-sizing: border-box !important;
}

/* Override any responsive classes that might break layout */
.lg\\:flex-row, .lg\\:w-1\\/2, .lg\\:block, .lg\\:hidden {
    display: inherit !important;
    flex-direction: inherit !important;
    width: inherit !important;
}

#editorPanel {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 50% !important;
    max-width: 50% !important;
    overflow-y: auto !important;
}

#previewPanel {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    width: 50% !important;
    max-width: 50% !important;
    overflow-y: auto !important;
    background-color: #f8f9fa !important;
    padding: 10px !important;
}

/* Override ANY conflicting styles */
#previewPanel, #editorPanel {
    position: relative !important;
    float: none !important;
    clear: none !important;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    /* Hide everything except the print content */
    body * {
        visibility: hidden;
    }

    .print-content,
    .print-content * {
        visibility: visible;
    }

    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        font-family: Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
        color: #000 !important;
    }

    .cv-page {
        width: 100% !important;
        min-height: auto !important;
        padding: 0.5in !important;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: always;
        background: white !important;
    }

    .cv-page:last-child {
        page-break-after: avoid;
    }

    @page {
        margin: 0;
        size: A4;
    }

    /* Clean print styles */
    .print-content h1 {
        font-size: 18pt !important;
        font-weight: bold !important;
        margin-bottom: 4pt !important;
    }

    .print-content h2 {
        font-size: 14pt !important;
        font-weight: normal !important;
        margin-bottom: 8pt !important;
    }

    .print-content h3 {
        font-size: 12pt !important;
        font-weight: bold !important;
        margin-bottom: 6pt !important;
        border-bottom: 1pt solid #ccc !important;
        padding-bottom: 2pt !important;
    }

    .print-content h4 {
        font-size: 11pt !important;
        font-weight: bold !important;
        margin-bottom: 2pt !important;
    }

    .print-content p,
    .print-content li {
        font-size: 10pt !important;
        margin-bottom: 3pt !important;
    }

    .print-content ul {
        margin: 0 !important;
        padding-left: 12pt !important;
        list-style-type: disc !important;
        margin: 8pt 0 !important;
        padding-left: 16pt !important;
    }

    .print-content li {
        margin-bottom: 2pt !important;
    }

    .print-content .experience-item,
    .print-content .education-item {
        page-break-inside: avoid;
        margin-bottom: 8pt !important;
    }

    /* Remove background colors and shadows */
    .print-content * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Formatted text print styles */
    .print-content strong,
    .print-content b {
        font-weight: bold !important;
    }

    .print-content em,
    .print-content i {
        font-style: italic !important;
    }

    .print-content u {
        text-decoration: underline !important;
    }

    .print-content mark {
        background-color: #f0f0f0 !important;
        padding: 1px 2px !important;
        border: 1px solid #ccc !important;
    }
}