:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #011a8b 100%);
    min-height: 100vh;
    color: var(--dark-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    color: white;
    padding: 40px 0;
    animation: fadeIn 1s ease-in;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Campanhas Ativas */
.campanhas-ativas {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: slideUp 0.8s ease-out;
}

.campanhas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.campanha-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.campanha-card:hover {
    transform: translateY(-5px);
}

/* Acesso Cards */
.acesso-container {
    text-align: center;
    margin-top: 40px;
}

.acesso-opcoes {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.acesso-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.acesso-card:hover {
    transform: translateY(-5px);
}

.acesso-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-acessar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.btn-acessar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.btn-anonimo {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Quiz Container */
.quiz-container {
    max-width: 800px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 40px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.quiz-timer {
    text-align: center;
}

.timer-display {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
    font-family: monospace;
}

.timer-label {
    color: #6b7280;
    font-size: 0.9em;
}

.quiz-alert {
    background: var(--warning-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: pulse 2s infinite;
}

.quiz-progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

/* Questions */
.question-card {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question-card.active {
    display: block;
}

.question-number {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.3em;
    margin-bottom: 30px;
    line-height: 1.6;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: #f5f3ff;
}

.option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.option-text {
    font-size: 1.1em;
}

/* Feedback */
.feedback-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    animation: slideIn 0.5s ease;
}

.feedback.correct {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* Navigation */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.btn-nav, .btn-submit {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-nav {
    background: #e5e7eb;
    color: var(--dark-color);
}

.btn-nav:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    background: var(--success-color);
    color: white;
}

.btn-submit:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* Resultado Page */
.resultado-container {
    max-width: 1000px;
}

.resultado-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.resultado-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.resultado-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.info-item {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
}

.info-label {
    display: block;
    color: #6b7280;
    margin-bottom: 10px;
}

.info-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.info-value.highlight {
    color: var(--success-color);
    font-size: 2em;
}

/* Ranking */
.ranking-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.3s ease;
}

.ranking-item:hover {
    background: #f9fafb;
}

.ranking-item.current-user {
    background: #f5f3ff;
    border-left: 4px solid var(--primary-color);
}

.ranking-posicao {
    font-weight: bold;
    color: var(--primary-color);
    width: 50px;
}

.ranking-nome {
    flex: 1;
    font-weight: 500;
}

.ranking-pontos {
    font-weight: bold;
    color: var(--success-color);
    margin-right: 10px;
}

.ranking-tempo {
    color: #6b7280;
    font-size: 0.9em;
}

/* Admin Area */
.admin-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 40px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.btn-logout {
    background: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn-logout:hover {
    background: #dc2626;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e5e7eb;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Admin Cards */
.campanhas-lista {
    display: grid;
    gap: 20px;
}

.campanha-admin-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.campanha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.status-ativa {
    background: #d1fae5;
    color: #065f46;
}

.status-inativa {
    background: #fee2e2;
    color: #991b1b;
}

.status-finalizada {
    background: #e5e7eb;
    color: #4b5563;
}

.campanha-datas {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    color: #6b7280;
}

.campanha-premio {
    margin: 10px 0;
    color: var(--primary-color);
    font-weight: 500;
}

.campanha-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.campanha-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-editar {
    background: var(--primary-color);
    color: white;
}

.btn-perguntas {
    background: var(--success-color);
    color: white;
}

.btn-ranking {
    background: var(--warning-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.5s ease;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #6b7280;
}

.close:hover {
    color: var(--dark-color);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .acesso-opcoes {
        flex-direction: column;
    }
    
    .acesso-card {
        max-width: 100%;
    }
    
    .quiz-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-timer {
        margin-top: 20px;
    }
    
    .resultado-info {
        grid-template-columns: 1fr;
    }
    
    .campanha-actions {
        flex-direction: column;
    }
    
    .campanha-actions button {
        width: 100%;
    }
}