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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    margin-bottom: 30px;
    padding: 25px 40px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo i {
    font-size: 3rem;
    background: white;
    color: #2c3e50;
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Layout principal */
.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

/* Sidebar */
.sidebar {
    flex: 0 0 320px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.sidebar-section h3 i {
    color: #3498db;
}

#template-list {
    list-style: none;
}

#template-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #27ae60;
    font-weight: 500;
}

.tip {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.tip ul {
    margin-left: 20px;
    margin-top: 10px;
}

.tip li {
    margin-bottom: 5px;
    color: #555;
}

.template-status {
    padding: 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.template-status p {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Conteúdo principal */
.content {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Formulário */
.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.form-section h2 i {
    color: #3498db;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group label i {
    color: #3498db;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Opções de checkbox */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    transition: transform 0.2s;
}

.option-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.option-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
}

/* Botões */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    position: relative;
}

.btn-generate,
.btn-reset,
.btn-download-all,
.btn-download-individual,
.btn-copy {
    padding: 16px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
}

.btn-generate {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    flex: 2;
}

.btn-generate:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f639b 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

.btn-reset {
    background: #95a5a6;
    color: white;
    flex: 1;
}

.btn-reset:hover {
    background: #7f8c8d;
    transform: translateY(-3px);
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #3498db;
    font-weight: 600;
    border-radius: 8px;
    z-index: 10;
}

/* Resultados */
.hidden {
    display: none !important;
}

.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 3px solid #3498db;
}

.success-message {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #c3e6cb;
}

.success-message i {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.success-detail {
    margin-top: 8px;
    color: #0c4128;
    font-size: 0.95rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.document-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 25px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.document-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.document-card h4 i {
    color: #3498db;
}

.document-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.document-buttons {
    display: flex;
    gap: 10px;
}

.btn-download,
.btn-preview {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-download {
    background: linear-gradient(135deg, #27ae60 0%, #219653 100%);
    color: white;
}

.btn-download:hover {
    background: linear-gradient(135deg, #219653 0%, #1e7e34 100%);
    transform: translateY(-2px);
}

.btn-preview {
    background: #e0e0e0;
    color: #333;
}

.btn-preview:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

/* Download em lote */
.download-options {
    background: #e8f4f8;
    border-radius: 10px;
    padding: 30px;
    margin: 40px 0;
    text-align: center;
    border: 2px solid #d1ecf1;
}

.download-options h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-options p {
    color: #555;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-download-all,
.btn-download-individual {
    margin: 0 10px;
    padding: 15px 25px;
}

.btn-download-all {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.btn-download-all:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(155, 89, 182, 0.3);
}

.btn-download-individual {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-download-individual:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f639b 100%);
    transform: translateY(-3px);
}

/* Resumo de dados */
.data-summary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    border: 2px solid #e9ecef;
}

.data-summary h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    position: relative;
}

#data-summary-content {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.btn-copy {
    background: #6c757d;
    color: white;
    padding: 12px 25px;
    width: auto;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 25px;
    color: #7f8c8d;
    border-top: 1px solid #ddd;
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-info {
    margin-top: 8px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsividade */
@media (max-width: 1200px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
    }
    
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-generate,
    .btn-reset {
        width: 100%;
    }
    
    .download-options {
        padding: 20px;
    }
    
    .btn-download-all,
    .btn-download-individual {
        margin: 10px 0;
        width: 100%;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo i {
        margin-bottom: 15px;
    }
}
