:root {
    --primary: #2196F3;
    --success: #4CAF50;
    --warning: #FFC107;
    --error: #F44336;
    --purple: #9C27B0;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --gray: #9e9e9e;
    --dark-gray: #424242;
    --black: #212121;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-gray);
    color: var(--black);
    line-height: 1.6;
    padding-bottom: 80px;
}

.header {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: var(--white);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

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

.main-content {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.section-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Welcome Card */
.welcome-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.welcome-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.welcome-card p {
    color: var(--gray);
    margin-bottom: 2rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.stat-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Forms */
.cronograma-form,
.newsletter-form {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--black);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--white);
}

.btn-primary {
    background: var(--primary);
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--success);
}

.btn-secondary:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* Cronograma Results */
.cronograma-resultado {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.resultado-header h3 {
    color: var(--success);
    font-size: 1.5rem;
}

.resultado-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-left: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 1.5rem;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--white);
}

.timeline-item.urgent::before {
    background: var(--error);
}

.timeline-item.warning::before {
    background: var(--warning);
}

.timeline-date {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.timeline-description {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Newsletter Preview */
.newsletter-preview {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.preview-header h3 {
    color: var(--primary);
    font-size: 1.5rem;
}

.preview-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.newsletter-content {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 2rem;
    background: var(--light-gray);
    min-height: 300px;
}

/* Biblioteca */
.biblioteca-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.biblioteca-lista {
    display: grid;
    gap: 1rem;
}

.biblioteca-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.biblioteca-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.biblioteca-item h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.biblioteca-item .tag {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.biblioteca-item .tag.reforma {
    background: var(--error);
}

.biblioteca-item .tag.prazos {
    background: var(--warning);
}

.biblioteca-item .tag.obrigacoes {
    background: var(--success);
}

/* Métricas */
.metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metrica-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metrica-icon {
    font-size: 2rem;
    color: var(--primary);
}

.metrica-info h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--black);
}

.metrica-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.chart-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.newsletters-enviadas {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.newsletters-enviadas h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

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

.newsletter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.newsletter-item-info h4 {
    margin-bottom: 0.25rem;
    color: var(--black);
}

.newsletter-item-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.newsletter-item-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.newsletter-item-stats span {
    color: var(--gray);
}

/* FAQ */
.faq-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.faq-section h2 {
    color: var(--primary);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    padding: 1.5rem 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--black);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding-bottom: 1.5rem;
    color: var(--gray);
    line-height: 1.6;
    transition: var(--transition);
}

.faq-answer[hidden] {
    display: none;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--gray);
    transition: var(--transition);
    border-radius: var(--border-radius);
    min-width: 60px;
}

.nav-item.active,
.nav-item:hover {
    color: var(--primary);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--dark-gray);
    color: var(--white);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .welcome-card,
    .cronograma-form,
    .newsletter-form {
        padding: 1.5rem;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .resultado-header,
    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .resultado-actions,
    .preview-actions {
        width: 100%;
    }
    
    .resultado-actions .btn,
    .preview-actions .btn {
        flex: 1;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-item {
        margin-left: 0.5rem;
        padding: 1rem;
    }
    
    .timeline-item::before {
        left: -1.5rem;
    }
    
    .metricas-grid {
        grid-template-columns: 1fr;
    }
    
    .metrica-card {
        padding: 1.5rem;
    }
    
    .newsletter-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .newsletter-item-stats {
        justify-content: space-between;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .biblioteca-filters {
        justify-content: center;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-weight: 500;
}

.message.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.message.error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.message.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #F57C00;
    border: 1px solid var(--warning);
}
