:root {
    --primary: #2563EB;
    --secondary: #DC2626;
    --contraste: #FFFFFF;
    --destaque: #FBBF24;
    --dark: #1E293B;
    --light: #F8FAFC;
    --success: #10B981;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, #0F172A 100%);
    color: white;
    padding: 30px 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.sidebar-brand span { color: var(--destaque); }

.sidebar-nav { list-style: none; padding: 0; }

.sidebar-nav li { margin: 5px 15px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--destaque);
}

.sidebar-nav a i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.top-bar h1 {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.6rem;
}

.btn-admin {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-admin.primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    color: white;
}

.btn-admin.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.4);
    color: white;
    text-decoration: none;
}

.btn-admin.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-admin.danger {
    background: linear-gradient(135deg, var(--secondary) 0%, #B91C1C 100%);
    color: white;
}

.btn-admin.warning {
    background: linear-gradient(135deg, var(--destaque) 0%, #F59E0B 100%);
    color: var(--dark);
}

.card-admin {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-admin h3 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.quiz-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.quiz-item:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.quiz-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 20px;
}

.quiz-item-info { flex: 1; }

.quiz-item-info h4 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}

.quiz-item-info p {
    color: #64748B;
    font-size: 0.9rem;
    margin: 0;
}

.quiz-item-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 1rem;
}

.btn-action.edit { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.btn-action.edit:hover { background: var(--primary); color: white; }
.btn-action.preview { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.btn-action.preview:hover { background: var(--success); color: white; }
.btn-action.delete { background: rgba(220, 38, 38, 0.1); color: var(--secondary); }
.btn-action.delete:hover { background: var(--secondary); color: white; }

.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-status.ativo { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-status.inativo { background: rgba(220, 38, 38, 0.1); color: var(--secondary); }

.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.alert.error { background: rgba(220, 38, 38, 0.1); color: var(--secondary); border: 1px solid var(--secondary); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748B;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #CBD5E1;
}

.empty-state h3 { font-weight: 600; margin-bottom: 10px; }

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

.form-group label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.btn-generate {
    padding: 16px 45px;
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-animation {
    display: none;
    text-align: center;
    padding: 40px;
}

.ai-animation.active {
    display: block;
}

.ai-brain {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.template-card {
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover, .template-card.selected {
    border-color: var(--primary);
    background: white;
}

.template-card h4 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.template-card p {
    font-size: 0.9rem;
    color: #64748B;
    margin: 0;
}

.template-card input[type="radio"] {
    margin-right: 10px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-weight: 700;
    color: var(--dark);
    font-size: 1.6rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--light);
    color: var(--dark);
    text-decoration: none;
}

.btn-save {
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.section-trigger {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin-bottom: 30px;
}

.section-trigger.dor { border-left-color: var(--secondary); }
.section-trigger.solucao { border-left-color: var(--success); }
.section-trigger.cta { border-left-color: var(--destaque); }

.question-item {
    background: var(--light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-header h4 {
    font-weight: 600;
    color: var(--dark);
}

.btn-remove {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    background: rgba(220, 38, 38, 0.1);
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-remove:hover {
    background: var(--secondary);
    color: white;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.option-item input[type="text"] {
    flex: 1;
}

.option-item input[type="number"] {
    width: 80px;
}

.btn-add {
    padding: 10px 20px;
    background: transparent;
    border: 2px dashed #CBD5E1;
    border-radius: 10px;
    color: #64748B;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 8px; }

@media (max-width: 992px) {
    .sidebar { width: 80px; }
    .sidebar-brand { font-size: 1.2rem; padding: 0 10px 20px; }
    .sidebar-nav a span { display: none; }
    .sidebar-nav a i { margin-right: 0; width: 100%; text-align: center; }
    .main-content { margin-left: 80px; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        padding: 16px 0;
        overflow-y: visible;
    }

    .sidebar-brand {
        font-size: 1.4rem;
        padding: 0 16px 16px;
        margin-bottom: 16px;
    }

    .sidebar-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 0 16px 4px;
        scrollbar-width: thin;
    }

    .sidebar-nav li {
        margin: 0;
        flex: 0 0 auto;
    }

    .sidebar-nav a {
        padding: 12px 16px;
        white-space: nowrap;
    }

    .sidebar-nav a span {
        display: inline;
    }

    .sidebar-nav a i {
        margin-right: 8px;
        width: auto;
        text-align: center;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .top-bar { flex-direction: column; gap: 15px; }
    .quiz-item { flex-direction: column; text-align: center; }
    .quiz-item img { margin: 0 auto 15px; }
    .quiz-item-actions { margin-top: 15px; }
}
