/**
 * Estilos para a área do administrador
 * Embarque Premiado
 */

/* Padrões Gerais */
body {
    background-color: #f8f9fc;
    font-family: 'Barlow Semi Condensed', sans-serif;
}

/* Layout de largura total */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.content-wrapper {
    width: calc(100% - 250px);
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Container centralizado com 90% de largura e máximo de 1200px */
.cert-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        width: 100%;
        margin-left: 0;
    }
}

.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

/* Tela de Login */
.login-bg {
    background-color: #224abe; /* Fallback sólido */
    background-image: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
}

/* Login — cartão e cabeçalho */
.login-card {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #ffffff;
}

.login-header {
    background: linear-gradient(135deg, #224abe 0%, #1b2a99 100%);
    border-bottom: 0;
}

.login-brand {
    text-align: center;
}

.brand-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* Login — grupos de input com ícones */
.login-card .input-group .input-group-text {
    background-color: #f1f3f9;
    border-color: #dfe3eb;
    color: #224abe;
}

.login-card .form-control {
    border-color: #dfe3eb;
}

.login-card .form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.login-card .input-group .btn {
    border-color: #dfe3eb;
}

#togglePassword {
    color: #224abe;
}

#togglePassword:hover {
    background-color: #eef2ff;
    color: #1b2a99;
}

/* Login — botão principal alinhado à paleta */
.login-card .btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.login-card .btn-primary:hover {
    background-color: #3956c3;
    border-color: #3956c3;
}

/* Login — rodapé do card */
.login-card .card-footer {
    background-color: #ffffff;
    border-top-color: #f0f2f7;
}

/* Responsividade específica do login */
@media (max-width: 576px) {
    .brand-logo { height: 52px; }
    .login-card { border-radius: 12px; }
}

/* Dashboard */
.card-body {
    flex: 1 1 auto;
    min-height: 1px;
    padding: 1.25rem;
}

.text-xs {
    font-size: .7rem;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Navbar */
.navbar-brand {
    font-weight: bold;
}

/* Table actions */
.table .btn-group {
    white-space: nowrap;
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 200px; /* Garante espaço suficiente para os botões */
    justify-content: flex-start;
}

/* Lista de Participantes: padroniza botões de Ações (inclui anchors) */
.participants-actions .btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* Neutral style overriding Bootstrap variants */
    background-color: #f3f4f6 !important; /* gray-100/200 */
    border: 1px solid #e5e7eb !important; /* gray-200 */
    color: #374151 !important; /* gray-700 text */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.participants-actions .btn:hover {
    transform: translateY(-1px);
    background-color: #e9ecef !important; /* slightly darker on hover */
    border-color: #dfe3eb !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}
.participants-actions .btn:active {
    background-color: #e2e6ea !important;
    border-color: #d6dae0 !important;
}
.participants-actions .btn:disabled,
.participants-actions .btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.participants-actions .btn i {
    line-height: 1;
    color: #2f3640 !important; /* darker icon */
}

/* Botões de ação modernos */
.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid #e2e2e2;
    color: #5a5c69;
    background-color: #fff;
    margin: 0 2px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-decoration: none !important;
    flex-shrink: 0; /* Impede que o botão encolha */
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
}

.action-btn-primary {
    color: #4e73df;
    border-color: #4e73df;
}

.action-btn-primary:hover {
    background-color: #4e73df;
    color: white;
}

.action-btn-success {
    color: #1cc88a;
    border-color: #1cc88a;
}

.action-btn-success:hover {
    background-color: #1cc88a;
    color: white;
}

.action-btn-warning {
    color: #f6c23e;
    border-color: #f6c23e;
}

.action-btn-warning:hover {
    background-color: #f6c23e;
    color: white;
}

.action-btn-info {
    color: #36b9cc;
    border-color: #36b9cc;
}

.action-btn-info:hover {
    background-color: #36b9cc;
    color: white;
}

.action-btn-danger {
    color: #e74a3b;
    border-color: #e74a3b;
}

.action-btn-danger:hover {
    background-color: #e74a3b;
    color: white;
}

.action-btn-secondary {
    color: #858796;
    border-color: #858796;
}

.action-btn-secondary:hover {
    background-color: #858796;
    color: white;
}

/* Remover marcador padrão do summary e alinhar com botões de ação */
details > summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }
details > summary.action-btn { display: inline-flex; }

/* Estado desabilitado para botões de ação */
.action-btn:disabled,
.action-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Forms */
.required-field::after {
    content: "*";
    color: #e74a3b;
    margin-left: 3px;
}

/* Quiz Creator */
.quiz-creator .card {
    transition: all 0.3s ease;
}

.quiz-creator .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.question-item {
    position: relative;
    border-left: 4px solid #4e73df;
    margin-bottom: 1rem;
}

.question-item .question-handle {
    cursor: move;
    background-color: rgba(78, 115, 223, 0.1);
    padding: 0.5rem;
}

.option-item {
    position: relative;
    padding: 0.5rem;
    border-left: 3px solid #e2e2e2;
    margin-bottom: 0.5rem;
    background-color: #f9f9f9;
}

.option-item.correct {
    border-left: 3px solid #1cc88a;
    background-color: rgba(28, 200, 138, 0.1);
}

/* Estilo para ícones de ação nos cards */
.icon-action {
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-action:hover {
    transform: scale(1.2);
}

/* Aumento de ícones na página de eventos (+30%) */
.events-page .event-card-actions i {
    font-size: 1.56rem; /* 1.2rem * 1.3 */
    line-height: 1;
}

/* Ajuste de layout dos botões na página de eventos para acomodar ícone maior */
.events-page .event-card-actions a.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Quiz Preview */
.quiz-preview .option-box {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.quiz-preview .option-box:hover {
    transform: translateY(-3px);
}

.quiz-preview .option-box.red {
    background-color: #e74a3b;
    color: white;
}

.quiz-preview .option-box.blue {
    background-color: #4e73df;
    color: white;
}

.quiz-preview .option-box.yellow {
    background-color: #f6c23e;
    color: white;
}

.quiz-preview .option-box.green {
    background-color: #1cc88a;
    color: white;
}

/* Timer */
.timer-circle {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.timer-circle .progress {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: none;
    position: relative;
}

.timer-circle .progress::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
}

.timer-circle .progress-value {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 1;
}

/* Resultados */
.result-card {
    border-radius: 8px;
    overflow: hidden;
}

.result-card .rank {
    font-size: 2rem;
    font-weight: bold;
    color: #4e73df;
}

.result-card.rank-1 {
    background-color: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.result-card.rank-1 .rank {
    color: #ffc107;
}

.result-card.rank-2 {
    background-color: rgba(192, 192, 192, 0.1);
    border: 1px solid rgba(192, 192, 192, 0.5);
}

.result-card.rank-2 .rank {
    color: #adb5bd;
}

.result-card.rank-3 {
    background-color: rgba(205, 127, 50, 0.1);
    border: 1px solid rgba(205, 127, 50, 0.5);
}

.result-card.rank-3 .rank {
    color: #cd7f32;
}

/* Remover underline e fixar layout dos botões */
.action-btn i {
    text-decoration: none !important;
}

/* Container para botões dinâmicos */
#action-buttons-container {
    display: flex;
    flex-wrap: nowrap;
}

/* Ajuste para o container de botões dinâmicos dentro da tabela */
.table td .btn-group {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    max-width: 100%;
    overflow: visible;
}

/* Container específico para botões de ação */
[id^="action-buttons-"] {
    display: inline-flex;
    flex-wrap: nowrap;
}

/* Estilos para o modal de feedback */
.feedback-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    text-align: center;
    min-width: 250px;
}

/* Mailing — tabela de campanhas */
#campaigns-tbody td { vertical-align: middle; }
#campaigns-tbody td.actions-cell { white-space: nowrap; }
#campaigns-tbody td.actions-cell .btn { padding: .25rem .5rem; line-height: 1; border-radius: .375rem; }

.feedback-modal .spinner-border {
    margin-bottom: 10px;
    color: #4e73df;
}

/* Estatísticas Q&A - linha única, ocupando 100% do card */
.qna-stats-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    column-gap: clamp(0.5rem, 2vw, 2rem);
    row-gap: 0; /* manter em uma única linha */
    justify-items: center; /* centraliza cada célula no grid */
    width: 100%;
    padding: 0.5rem 0; /* respiro vertical */
}

.qna-stat {
    min-width: 0; /* permitir compressão uniforme */
    padding: 0.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qna-stat h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 0.2rem !important; /* separar do rótulo, sobrepõe .mb-0 */
}

.qna-stat small {
    display: block;
    margin-top: 0;
    line-height: 1;
    white-space: nowrap; /* evitar quebra do rótulo */
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .question-item .question-handle {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .question-item .question-handle .btn-group {
        margin-top: 0.5rem;
    }
    
    .timer-circle {
        width: 80px;
        height: 80px;
    }
    
    .timer-circle .progress::after {
        top: 8px;
        left: 8px;
        width: 64px;
        height: 64px;
    }
    
    .qna-stats-row { column-gap: 0.5rem; }
    .qna-stat h4 { font-size: 1.05rem; }
    .qna-stat small { font-size: 0.82rem; }
}

@media (max-width: 576px) {
    .qna-stat h4 { font-size: 1rem; }
    .qna-stat small { font-size: 0.78rem; }
}

/* Modal de Filtro Avançado — largura 70% da viewport com fallbacks */
#advancedFilterModal .modal-dialog {
    max-width: 70vw;
    width: 70vw;
}

@media (max-width: 992px) {
    #advancedFilterModal .modal-dialog {
        max-width: 90vw;
        width: 90vw;
    }
}

@media (max-width: 576px) {
    #advancedFilterModal .modal-dialog {
        max-width: 95vw;
        width: 95vw;
        margin: 0.5rem auto; /* reduzir margens laterais em telas muito pequenas */
    }
}

/* Preview do Logo do Evento */
.logo-preview-box {
    background-color: #1B0088;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.logo-preview-img {
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Eventos — Cards mais sóbrios e modernos */
.events-page .event-card {
    border: 1px solid #e6e9ef;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.events-page .event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
}

/* Logo do evento com fundo azul mais escuro para maior contraste */
.events-page .event-logo-wrap {
    width: 52px;   /* +30% aprox */
    height: 52px;  /* +30% aprox */
    border-radius: 14px;
    background: #0F004F; /* azul escuro da marca */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.events-page .event-logo-img {
    max-width: 88%;   /* levemente maior dentro do box */
    max-height: 88%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.events-page .event-logo-fallback {
    color: #fff;
    line-height: 1;
}

/* Botões neutros/ghost para ações nos cards de evento */
.btn-ghost {
    background: #ffffff !important;
    color: #334155 !important; /* slate-700 */
    border: 1px solid #e5e7eb !important; /* slate-200 */
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn-ghost:hover {
    background: #f8fafc !important; /* slate-50 */
    border-color: #e2e8f0 !important; /* slate-200 */
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.btn-ghost:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
    background: #f1f5f9 !important; /* slate-100 */
}
.btn-ghost:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30,64,175,0.12); /* azul translúcido */
}

/* Botão neutro e moderno (sem cor), para ações gerais */
.btn-neutral {
    background: #ffffff !important;
    color: #0f172a !important; /* slate-900 */
    border: 1px solid #e5e7eb !important; /* slate-200 */
    border-radius: 10px !important; /* cantos levemente arredondados */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
    padding: .475rem .9rem;
    font-weight: 500;
}
.btn-neutral i { color: #0f172a !important; }
.btn-neutral:hover {
    background: #f8fafc !important; /* slate-50 */
    border-color: #e2e8f0 !important; /* slate-200 */
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.btn-neutral:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
    background: #f1f5f9 !important; /* slate-100 */
}
.btn-neutral:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2,6,23,0.12); /* slate escuro translúcido */
}
.btn-neutral:disabled,
.btn-neutral[disabled] {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* Botões de estatística (cards clicáveis, monocromáticos, com sombra sutil) */
.stat-btn {
    display: block;
    width: 100%;
    background: #ffffff;
    color: #0f172a; /* slate-900 */
    border: 0; /* sem borda escura */
    border-radius: 14px; /* cantos mais arredondados */
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    padding: 0.9rem 0.75rem;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.stat-btn:hover {
    background: #f8fafc; /* slate-50 */
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.10);
}
.stat-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    background: #f1f5f9; /* slate-100 */
}
.stat-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2,6,23,0.12), 0 6px 16px rgba(0,0,0,0.06);
}
.stat-btn.active {
    background: #f8fafc;
}

/* Ajustes de tipografia e layout nos botões de ação dentro dos cards */
.events-page .event-card-actions .btn small {
    color: #475569; /* slate-600 */
}
.events-page .event-card-actions .btn i {
    color: #0f172a; /* slate-900 */
}

/* Section title stripe used across admin pages (matches graduation.php style) */
.section-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background-color: #f8f9fa; /* light gray */
    border: 1px solid #e9ecef; /* light border */
    border-radius: .5rem; /* rounded corners */
    padding: .5rem .75rem; /* compact padding */
    font-weight: 700; /* bold */
    font-size: 1.35rem; /* slightly larger for emphasis */
    line-height: 1.2;
    color: #0f172a; /* dark text */
}
.section-title i { color: #0d6efd !important; } /* blue icon */
