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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

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

.logo i {
    font-size: 2rem;
    color: #3498db;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Media Queries para Header */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .nav {
        justify-content: center;
        width: 100%;
    }
    
    .nav-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        text-decoration: none;
    }
}

/* Main Content */
.main-content {
    padding: 2rem;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

/* Dashboard Styles */
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #f39c12, #e67e22); }

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.stat-info small {
    color: #95a5a6;
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}

/* Recent Activities */
.recent-activities {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recent-activities h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-item i {
    color: #3498db;
    font-size: 1.2rem;
}

.activity-item span {
    flex: 1;
    color: #2c3e50;
}

.activity-item time {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 2rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #3498db;
}

/* Patients Grid */
.patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.patient-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.patient-card:hover {
    transform: translateY(-3px);
}

.patient-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.patient-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.patient-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.status-badge.priority {
    background: #fee;
    color: #e74c3c;
}

.status-badge.normal {
    background: #efe;
    color: #27ae60;
}

/* Calendar View */
.calendar-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.visit-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.visit-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3498db;
    min-width: 80px;
}

.visit-details h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.visit-details p {
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.visit-type {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #e8f4fd;
    color: #3498db;
}

.visit-type.urgent {
    background: #fee;
    color: #e74c3c;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.report-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.report-card:hover {
    transform: translateY(-5px);
}

.report-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.report-card p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.report-number {
    font-size: 3rem;
    font-weight: 700;
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-header h2 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .patients-grid {
        grid-template-columns: 1fr;
    }
    
    .visit-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.action-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: center;
    flex: 1;
    max-width: 300px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.action-btn.secondary {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Media Queries para Responsividade dos Botões */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: none;
        min-width: auto;
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }
}

/* Progress Section */
.progress-section {
    margin-top: 3rem;
}

.progress-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.subject-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #3498db;
    cursor: pointer;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.subject-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.subject-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.subject-info p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.progress-bar {
    background: #ecf0f1;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 600;
}

/* Quiz Options */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.quiz-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.quiz-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.quiz-info { 
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.quiz-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.quiz-info p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    text-decoration: none;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.4);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Centraliza botões dentro dos cards de questões */
.quiz-info .btn-primary,
.quiz-info .btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-self: center;
    margin-top: auto; /* empurra o botão para a base do card */
}

/* Recent Quizzes */
.recent-quizzes {
    margin-top: 3rem;
}

.recent-quizzes h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.quiz-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.quiz-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.quiz-subject {
    color: #2c3e50;
    font-weight: 600;
}

.quiz-score {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.quiz-score.success {
    background: #d5f4e6;
    color: #27ae60;
}

.quiz-score.good {
    background: #fef9e7;
    color: #f39c12;
}

/* Welcome Block */
.welcome-block {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
}

.welcome-block h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-block p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.welcome-block .action-buttons {
    margin: 0;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.welcome-block .action-btn {
    background: white;
    color: #2c3e50;
    border: 2px solid white;
    padding: 0.8rem 1.8rem;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 180px;
    flex: 1;
    max-width: 220px;
}

.welcome-block .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.welcome-block .action-btn.primary {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-color: #27ae60;
}

.welcome-block .action-btn.primary:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.welcome-block .action-btn.secondary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border-color: #f39c12;
}

.welcome-block .action-btn.secondary:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.4);
}

/* Media Queries para Welcome Block */
@media (max-width: 768px) {
    .welcome-block .action-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .welcome-block .action-btn {
        width: 100%;
        max-width: none;
        min-width: auto;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .welcome-block h2 {
        font-size: 2rem;
    }
    
    .welcome-block p {
        font-size: 1.1rem;
    }
}

/* Lei 8080 Section Styles */
.law-content {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.law-chapter {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #e74c3c;
}

.law-chapter h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
}

.law-chapter h3 i {
    color: #e74c3c;
}

.law-topics {
    display: grid;
    gap: 1rem;
}

.topic-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 3px solid #3498db;
    transition: all 0.3s ease;
}

.topic-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.topic-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.topic-item p {
    color: #7f8c8d;
    margin: 0;
    line-height: 1.6;
}

.law-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

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

.back-btn i {
    font-size: 0.8rem;
}

/* Responsive adjustments for Lei 8080 section */
@media (max-width: 768px) {
    .law-content {
        gap: 1.5rem;
    }
    
    .law-chapter {
        padding: 1.5rem;
    }
    
    .law-chapter h3 {
        font-size: 1.2rem;
    }
    
    .topic-item {
        padding: 1rem;
    }
    
    .law-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .law-actions button {
        width: 100%;
        max-width: 300px;
    }
}

/* Destaque temporário ao iniciar estudos */
.study-focus {
    outline: 3px solid #3498db;
    border-radius: 12px;
    animation: studyPulse 1.5s ease-in-out 2;
}

@keyframes studyPulse {
    0% { box-shadow: 0 0 0 rgba(52, 152, 219, 0); }
    50% { box-shadow: 0 0 0 10px rgba(52, 152, 219, 0.15); }
    100% { box-shadow: 0 0 0 rgba(52, 152, 219, 0); }
}

/* Admin styles */
.admin-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

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

.admin-form .form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.admin-form .form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.admin-list h3 {
    margin-top: 2rem;
    color: #2c3e50;
}