/* Template Styles */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
}

/* Base resume preview styles */
.resume-preview {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Template selector styles */
.template-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.template-active {
    border-color: var(--primary-color) !important;
    background-color: #eff6ff;
}

/* ============================================
   TEMPLATE 1 - CLÁSSICO (Duas Colunas)
   ============================================ */
.resume-preview.template1 {
    background: white;
}

.resume-preview.template1 .section-title {
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.resume-preview.template1 h1 {
    color: #1f2937;
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.resume-preview.template1 h2 {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.5rem;
}

.resume-preview.template1 .skill-level-fill {
    background-color: var(--primary-color);
}

.resume-preview.template1 .grid {
    gap: 2rem;
}

/* Destaque para informações de contato no Template 1 */
.resume-preview.template1 ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.resume-preview.template1 ul li:last-child {
    border-bottom: none;
}

.resume-preview.template1 ul li i {
    color: var(--primary-color);
    width: 20px;
}

/* ============================================
   TEMPLATE 2 - MODERNO (Minimalista)
   ============================================ */
.resume-preview.template2 {
    background: #fafafa;
}

.resume-preview.template2 .section-title {
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
    border-bottom: none;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.resume-preview.template2 h1 {
    color: #1f2937;
    font-weight: 300;
    font-size: 2.8rem;
    letter-spacing: 3px;
    margin-bottom: 0.25rem;
}

.resume-preview.template2 h2 {
    color: #6b7280;
    font-weight: 400;
    font-size: 1.3rem;
    letter-spacing: 1px;
}

.resume-preview.template2 h4 {
    color: var(--primary-color);
    font-weight: 600;
}

.resume-preview.template2 .skill-level {
    background-color: #e5e7eb;
    height: 6px;
    border-radius: 3px;
}

.resume-preview.template2 .skill-level-fill {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 3px;
}

/* Estilo minimalista para contatos */
.resume-preview.template2 ul li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.resume-preview.template2 ul li i {
    color: var(--primary-color);
    width: 18px;
    font-size: 0.85rem;
}

/* Espaçamento clean */
.resume-preview.template2 .mb-8 {
    margin-bottom: 2.5rem;
}

.resume-preview.template2 .mb-6 {
    margin-bottom: 2rem;
}

/* ============================================
   TEMPLATE 3 - CRIATIVO (Visual Destacado)
   ============================================ */
.resume-preview.template3 {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
}

/* Barra lateral colorida */
.resume-preview.template3::before {
    content: '';
    --position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.resume-preview.template3 .section-title {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.resume-preview.template3 h1 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.resume-preview.template3 h2 {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1.5rem;
}

.resume-preview.template3 h4 {
    color: var(--primary-color);
    font-weight: 700;
}

/* Skill bars com gradiente */
.resume-preview.template3 .skill-level {
    background: linear-gradient(90deg, #e0e7ff 0%, #dbeafe 100%);
    border-radius: 1rem;
    height: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.resume-preview.template3 .skill-level-fill {
    background: linear-gradient(90deg, var(--primary-color) 0%, #8b5cf6 100%);
    border-radius: 1rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Ícones destacados */
.resume-preview.template3 ul li i {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.resume-preview.template3 ul li {
    padding: 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Cards para experiências */
.resume-preview.template3 .mb-6 {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1.5rem;
}

/* Foto de perfil com borda */
.resume-preview.template3 #previewProfileImage {
    border: 4px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

/* ============================================
   COMMON STYLES FOR ALL TEMPLATES
   ============================================ */

/* Color customization */
.resume-preview .section-title,
.resume-preview h2,
.resume-preview .skill-level-fill,
.resume-preview .progress-fill {
    transition: all 0.3s ease;
}

/* Profile image */
#previewProfileImage {
    border-radius: 50%;
    overflow: hidden;
}

/* Completeness indicator */
.completeness-indicator {
    position: sticky;
    top: 1rem;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.completeness-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 1rem;
    overflow: hidden;
}

.completeness-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.5s ease;
}

/* Auto-save indicator */
.autosave-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 0.875rem;
    font-weight: 500;
}

.autosave-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.autosave-indicator.saving {
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

.autosave-indicator.saved {
    color: #10b981;
    border-left: 4px solid #10b981;
}

.autosave-indicator i {
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .resume-preview {
        width: 100%;
        height: auto;
        min-height: 297mm;
    }
    
    .template-btn {
        margin-bottom: 1rem;
    }
    
    .resume-preview.template1 h1,
    .resume-preview.template2 h1,
    .resume-preview.template3 h1 {
        font-size: 2rem;
    }
}

/* Print styles for all templates */
@media print {
    .resume-preview {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 2rem !important;
    }
    
    .resume-preview.template1,
    .resume-preview.template2 {
        background: white !important;
    }
    
    .resume-preview.template3 {
        background: white !important;
        position: relative !important;
        padding: 2rem !important;
    }
    
    .resume-preview.template3::before {
        position: absolute !important;
        height: 100% !important;
    }
    
    /* Ensure colors print correctly */
    .resume-preview * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
