/* ===== CV Builder Styles ===== */

.cv-builder {
    padding: 100px 0 60px;
    background: var(--gray-50);
    min-height: 100vh;
}

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

.cv-builder-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.cv-builder-header h1 i {
    color: var(--primary);
    margin-right: 10px;
}

.cv-builder-header p {
    color: var(--text-light);
}

.cv-builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Form Section */
.cv-form-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.cv-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--gray-200);
}

.cv-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.cv-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-section h3 i {
    color: var(--primary);
    font-size: 1rem;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.template-option {
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
}

.template-option:hover {
    border-color: var(--primary-light);
}

.template-option.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.template-preview {
    height: 80px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.template-option span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
}

/* Template Preview Colors */
.modern-preview {
    background: linear-gradient(135deg, #6366f1 30%, #f8fafc 30%);
}

.classic-preview {
    background: linear-gradient(180deg, #1e293b 25%, #f8fafc 25%);
}

.professional-preview {
    background: linear-gradient(90deg, #0f172a 35%, #f8fafc 35%);
}

.creative-preview {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #f8fafc 50%);
}

.tech-preview {
    background: linear-gradient(180deg, #10b981 20%, #0f172a 20%, #0f172a 25%, #f8fafc 25%);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.cv-form-section .form-group {
    margin-bottom: 15px;
}

.cv-form-section .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.cv-form-section .form-group input,
.cv-form-section .form-group textarea,
.cv-form-section .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.cv-form-section .form-group input:focus,
.cv-form-section .form-group textarea:focus,
.cv-form-section .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Dynamic Lists */
.dynamic-list {
    margin-bottom: 15px;
}

.dynamic-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.dynamic-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
}

.dynamic-item .remove-btn:hover {
    background: #dc2626;
}

.add-btn {
    width: 100%;
}

/* Actions */
.cv-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.cv-actions .btn {
    flex: 1;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* Preview Section */
.cv-preview-section {
    position: sticky;
    top: 100px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
}

.preview-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-zoom button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.preview-zoom button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preview-zoom span {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 40px;
    text-align: center;
}

.preview-container {
    background: var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    overflow: auto;
    max-height: calc(100vh - 200px);
}

/* CV Preview */
.cv-preview {
    background: white;
    width: 210mm;
    min-height: 297mm;
    padding: 0;
    margin: 0 auto;
    box-shadow: var(--shadow-xl);
    transform-origin: top center;
    font-size: 11pt;
    line-height: 1.4;
}

/* ===== Template Styles ===== */

/* Modern Template */
.template-modern {
    display: grid;
    grid-template-columns: 35% 65%;
}

.template-modern .cv-sidebar {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 30px 25px;
}

.template-modern .cv-main {
    padding: 30px;
}

.template-modern .cv-name {
    font-size: 24pt;
    font-weight: 700;
    margin-bottom: 5px;
}

.template-modern .cv-title {
    font-size: 12pt;
    opacity: 0.9;
    margin-bottom: 25px;
}

.template-modern .cv-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 9pt;
}

.template-modern .cv-contact-item i {
    width: 16px;
    text-align: center;
}

.template-modern .cv-section-title {
    font-size: 11pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.template-modern .cv-main .cv-section-title {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.template-modern .cv-skill-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 8pt;
    margin: 3px;
}

.template-modern .cv-main .cv-skill-tag {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* Classic Template */
.template-classic .cv-header {
    background: #1e293b;
    color: white;
    padding: 30px;
    text-align: center;
}

.template-classic .cv-name {
    font-size: 28pt;
    font-weight: 700;
    margin-bottom: 5px;
}

.template-classic .cv-title {
    font-size: 14pt;
    opacity: 0.8;
}

.template-classic .cv-contact {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
    font-size: 10pt;
}

.template-classic .cv-body {
    padding: 30px;
}

.template-classic .cv-section-title {
    font-size: 13pt;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 8px;
    margin: 25px 0 15px;
}

/* Professional Template */
.template-professional {
    display: grid;
    grid-template-columns: 30% 70%;
}

.template-professional .cv-sidebar {
    background: #0f172a;
    color: white;
    padding: 30px 20px;
}

.template-professional .cv-main {
    padding: 30px;
}

.template-professional .cv-name {
    font-size: 20pt;
    font-weight: 700;
    margin-bottom: 5px;
}

.template-professional .cv-title {
    font-size: 11pt;
    color: #94a3b8;
    margin-bottom: 25px;
}

.template-professional .cv-section-title {
    font-size: 10pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 25px 0 15px;
    color: #64748b;
}

.template-professional .cv-main .cv-section-title {
    color: #0f172a;
    border-left: 3px solid #0f172a;
    padding-left: 10px;
}

/* Creative Template */
.template-creative {
    background: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 100%);
}

.template-creative .cv-header {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    padding: 40px 30px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.template-creative .cv-name {
    font-size: 32pt;
    font-weight: 800;
}

.template-creative .cv-title {
    font-size: 14pt;
    opacity: 0.9;
}

.template-creative .cv-body {
    padding: 30px;
    padding-top: 10px;
}

.template-creative .cv-section-title {
    font-size: 12pt;
    font-weight: 700;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 20px 0 15px;
}

/* Tech Template */
.template-tech {
    font-family: 'Consolas', 'Monaco', monospace;
}

.template-tech .cv-header {
    background: #10b981;
    padding: 5px 30px;
}

.template-tech .cv-header-main {
    background: #0f172a;
    color: #10b981;
    padding: 30px;
}

.template-tech .cv-name {
    font-size: 26pt;
    font-weight: 700;
    font-family: inherit;
}

.template-tech .cv-name::before {
    content: '> ';
    opacity: 0.5;
}

.template-tech .cv-title {
    color: #94a3b8;
    font-size: 12pt;
}

.template-tech .cv-body {
    padding: 30px;
    background: #f8fafc;
}

.template-tech .cv-section-title {
    font-size: 11pt;
    color: #10b981;
    margin: 20px 0 15px;
}

.template-tech .cv-section-title::before {
    content: '// ';
}

.template-tech .cv-skill-tag {
    background: #0f172a;
    color: #10b981;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 9pt;
    margin: 2px;
    display: inline-block;
}

/* Common CV Styles */
.cv-experience-item,
.cv-education-item {
    margin-bottom: 15px;
}

.cv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.cv-item-title {
    font-weight: 600;
    font-size: 11pt;
}

.cv-item-subtitle {
    color: #64748b;
    font-size: 10pt;
}

.cv-item-date {
    font-size: 9pt;
    color: #94a3b8;
    white-space: nowrap;
}

.cv-item-description {
    font-size: 10pt;
    color: #475569;
    margin-top: 5px;
}

.cv-summary {
    font-size: 10pt;
    color: #475569;
    line-height: 1.6;
}

.cv-language-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 10pt;
}

/* Responsive */
@media (max-width: 1200px) {
    .cv-builder-layout {
        grid-template-columns: 1fr;
    }

    .cv-preview-section {
        position: relative;
        top: 0;
    }

    .preview-container {
        max-height: 600px;
    }

    .cv-preview {
        transform: scale(0.6);
        transform-origin: top center;
    }
}

@media (max-width: 768px) {
    .cv-builder {
        padding: 80px 0 40px;
    }

    .cv-form-section {
        padding: 20px;
    }

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cv-actions {
        flex-direction: column;
    }

    .cv-preview {
        transform: scale(0.4);
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cv-preview {
        transform: scale(0.35);
    }
}

/* Print styles for PDF */
@media print {
    .cv-preview {
        box-shadow: none;
        transform: none !important;
    }
}
