/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 0;
    text-align: center;
    color: white;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.app-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Layout principal */
.main-content {
    padding: 2rem 0;
}

.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 80vh;
}

/* Seção do formulário */
.form-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: 80vh;
    overflow-y: auto;
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #718096;
    font-size: 1rem;
}

/* Formulário */
.cv-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    background: #f8fafc;
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.form-group h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group h3 i {
    color: #667eea;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Botões */
.btn-add, .btn-remove, .btn-primary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-add {
    background: #48bb78;
    color: white;
    margin-top: 1rem;
}

.btn-add:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-remove {
    background: #f56565;
    color: white;
    padding: 0.5rem;
    margin-top: 0.5rem;
    align-self: flex-start;
}

.btn-remove:hover {
    background: #e53e3e;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Items dinâmicos */
.experiencia-item, .formacao-item, .idioma-item {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    position: relative;
}

.experiencia-item:last-child, .formacao-item:last-child, .idioma-item:last-child {
    margin-bottom: 0;
}

/* Seção de preview */
.preview-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: 80vh;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.preview-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cv-preview {
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 2rem;
    background: white;
    min-height: 600px;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Templates de CV */
.cv-template {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #2d3748;
}

/* Template Moderno */
.template-moderno .cv-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
}

.template-moderno .cv-nome {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.template-moderno .cv-contato {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.template-moderno .cv-secao {
    margin-bottom: 2rem;
}

.template-moderno .cv-secao h3 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

/* Template Clássico */
.template-classico .cv-header {
    border-bottom: 3px solid #2d3748;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.template-classico .cv-nome {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.template-classico .cv-secao h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Template Criativo */
.template-criativo .cv-header {
    background: #4a5568;
    color: white;
    padding: 2rem;
    border-radius: 0 0 50px 50px;
    margin-bottom: 2rem;
    position: relative;
}

.template-criativo .cv-nome {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.template-criativo .cv-secao h3 {
    background: #4a5568;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Template Minimalista */
.template-minimalista .cv-header {
    border-left: 5px solid #2d3748;
    padding-left: 2rem;
    margin-bottom: 3rem;
}

.template-minimalista .cv-nome {
    font-size: 2rem;
    font-weight: 300;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.template-minimalista .cv-secao h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.template-minimalista .cv-secao h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: #2d3748;
}

/* Elementos comuns dos templates */
.cv-experiencia-item, .cv-formacao-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.cv-experiencia-item:last-child, .cv-formacao-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cv-cargo, .cv-curso {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d3748;
}

.cv-empresa, .cv-instituicao {
    color: #4a5568;
    font-weight: 500;
}

.cv-periodo {
    color: #718096;
    font-style: italic;
    font-size: 0.9rem;
}

.cv-descricao {
    margin-top: 0.5rem;
    color: #4a5568;
}

.cv-habilidades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cv-habilidade {
    background: #e2e8f0;
    color: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.notification-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.notification-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.notification-error {
    background: linear-gradient(135deg, #f56565, #e53e3e);
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estado vazio do preview */
.empty-state {
    text-align: center;
    color: #718096;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: #cbd5e0;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #4a5568;
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Funcionalidades Avançadas */

/* Tips Container */
.tips-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 1000;
    border-left: 5px solid #667eea;
    animation: slideInLeft 0.3s ease-out;
}

.tips-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tips-header h4 {
    color: #2d3748;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-close {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.tips-close:hover {
    background: #edf2f7;
    color: #2d3748;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

.tips-list li i {
    color: #f6ad55;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Additional Controls */
.additional-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

/* Enhanced Validation Styles */
.form-validation-error {
    border-color: #f56565 !important;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1) !important;
    animation: shake 0.5s ease-in-out;
}

.form-validation-success {
    border-color: #48bb78 !important;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Keyboard Shortcuts Help */
.shortcuts-help {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    z-index: 1001;
    min-width: 400px;
}

.shortcuts-help h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
    text-align: center;
}

.shortcuts-list {
    display: grid;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.shortcut-keys {
    display: flex;
    gap: 0.25rem;
}

.key {
    background: #2d3748;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 1002;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Auto-save Indicator */
.autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.autosave-indicator.show {
    opacity: 1;
}

/* Print Styles */
@media print {
    .app-header,
    .form-section,
    .preview-header,
    .notification,
    .tips-container,
    .autosave-indicator {
        display: none !important;
    }
    
    .app-layout {
        grid-template-columns: 1fr !important;
    }
    
    .preview-section {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .cv-preview {
        border: none !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tips-container {
        background: #2d3748;
        color: #e2e8f0;
        border-left-color: #667eea;
    }
    
    .tips-header h4 {
        color: #e2e8f0;
    }
    
    .tips-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .tips-list li {
        color: #cbd5e0;
    }
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .tips-container {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 10px;
    }
    
    .additional-controls {
        justify-content: center;
        width: 100%;
    }
    
    .btn-secondary {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-add, .btn-remove, .btn-primary, .btn-secondary {
        border: 2px solid currentColor;
    }
    
    .form-validation-error {
        border-width: 3px !important;
    }
    
    .form-validation-success {
        border-width: 3px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading::after {
        display: none;
    }
}

/* Melhorias gerais */
.cv-template {
    transition: all 0.3s ease;
}

.form-group {
    transition: all 0.3s ease;
}

.form-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Indicador visual para campos obrigatórios */
input[required] {
    position: relative;
}

input[required]::after {
    content: '*';
    color: #f56565;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Melhor contraste para acessibilidade */
.cv-habilidade {
    background: #e2e8f0;
    color: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
    display: inline-block;
    transition: all 0.2s ease;
}

.cv-habilidade:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* Tooltip personalizado */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 0.8rem;
}

/* Responsividade */
@media (max-width: 1200px) {
    .app-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-section, .preview-section {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .app-header h1 {
        font-size: 2rem;
    }
    
    .input-row {
        grid-template-columns: 1fr;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .preview-controls {
        justify-content: center;
    }
    
    .cv-contato {
        flex-direction: column !important;
        align-items: center;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group, .cv-template {
    animation: fadeIn 0.6s ease-out;
}

/* Scrollbar personalizada */
.form-section::-webkit-scrollbar,
.cv-preview::-webkit-scrollbar {
    width: 8px;
}

.form-section::-webkit-scrollbar-track,
.cv-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-section::-webkit-scrollbar-thumb,
.cv-preview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.form-section::-webkit-scrollbar-thumb:hover,
.cv-preview::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
