/* ============================================================
   Matriz F.O.C.O. — Custom CSS
   Estilo global complementar ao Tailwind
   ============================================================ */

/* Importação de fonte */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #f4f6fb;
    color: #1e293b;
    line-height: 1.6;
}

/* Garantir altura mínima em todas as páginas */
#appMain,
main {
    min-height: calc(100vh - 140px);
}

/* ============================================================
   Gradientes e cores de fundo
   ============================================================ */
.gradient-bg {
    background: linear-gradient(135deg, #000B1F 0%, #1a3350 50%, #546D8B 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, #000B1F 0%, #0d1f3c 40%, #546D8B 100%);
}

.gradient-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ============================================================
   Glass Panel
   ============================================================ */
.glass-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
    padding: 20px;
    border-radius: 16px;
    transition: box-shadow 0.2s ease;
}

.glass-panel:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   Prioridades da Matriz F.O.C.O.
   ============================================================ */
.priority-max   { background: linear-gradient(135deg, #dc2626, #991b1b); color: #fff; }
.priority-high  { background: linear-gradient(135deg, #ea580c, #c2410c); color: #fff; }
.priority-medium{ background: linear-gradient(135deg, #ca8a04, #a16207); color: #fff; }
.priority-low   { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }

.badge-max    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-high   { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.badge-medium { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.badge-low    { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* ============================================================
   Cartões de bancas
   ============================================================ */
.bank-tab {
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.bank-tab:hover,
.bank-tab.active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(84, 109, 139, 0.25);
}

.bank-tab.active {
    background: linear-gradient(135deg, #546D8B, #F76301) !important;
    color: white !important;
    border-color: transparent;
}

/* ============================================================
   Cards de editais
   ============================================================ */
.exam-card {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
    padding: 16px 20px;
    border-radius: 14px;
    background: #fff;
}

.exam-card:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    border-left-color: #546D8B;
}

/* ============================================================
   Inputs dos gabaritos
   ============================================================ */
.input-gabarito {
    transition: all 0.18s ease;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.input-gabarito:focus {
    outline: none;
    transform: scale(1.05);
    border-color: #546D8B;
    box-shadow: 0 0 0 3px rgba(84, 109, 139, 0.15);
}

/* ============================================================
   Tabela da Matriz
   ============================================================ */
.matrix-table th {
    background: linear-gradient(135deg, #000B1F, #1a3350);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.matrix-row {
    transition: background 0.15s;
}
.matrix-row:hover { background: #f8faff; }

/* Nível badge na tabela */
.nivel-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* ============================================================
   Score ring / progress
   ============================================================ */
.progress-ring { transform: rotate(-90deg); }
.progress-ring-circle {
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   Plano semanal
   ============================================================ */
.day-card {
    transition: transform 0.2s;
}
.day-card:hover { transform: translateY(-2px); }

.study-item {
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.study-item:hover { padding-left: 6px; }

.tipo-ESTUDO   { border-color: #546D8B; }
.tipo-REVISÃO  { border-color: #0891b2; }
.tipo-AVALIAÇÃO{ border-color: #F76301; }
.tipo-BAIXA    { border-color: #16a34a; }
.tipo-MÉDIA    { border-color: #ca8a04; }

/* ============================================================
   Cards de stat
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid #e8ecf1;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

/* ============================================================
   Formulários
   ============================================================ */
.form-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
    background: white;
    color: #1e293b;
}

.form-input:focus {
    outline: none;
    border-color: #546D8B;
    box-shadow: 0 0 0 3px rgba(84, 109, 139, 0.15);
}

.form-input::placeholder { color: #94a3b8; }

.btn-primary {
    background: linear-gradient(135deg, #F76301, #d95500);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 26px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.025em;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(247, 99, 1, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: white;
    color: #546D8B;
    border: 1.5px solid #dce3ec;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    border-color: #546D8B;
    background: #f0f3f7;
    transform: translateY(-1px);
}

/* ============================================================
   Animações
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.animate-fade-in      { animation: fadeIn 0.3s ease forwards; }
.animate-pulse-slow   { animation: pulse-slow 3s ease infinite; }

.animate-fade-in-delay-1 { animation: fadeIn 0.3s ease 0.1s both; }
.animate-fade-in-delay-2 { animation: fadeIn 0.3s ease 0.2s both; }
.animate-fade-in-delay-3 { animation: fadeIn 0.3s ease 0.3s both; }

/* ============================================================
   Tags infos dos conteúdos
   ============================================================ */
.topic-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: #dce3ec;
    color: #38485c;
    margin: 2px;
    display: inline-block;
    font-weight: 600;
}

/* ============================================================
   Scrollbar customizada
   ============================================================ */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    animation: fadeIn 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
}

/* ============================================================
   Sidebar admin (reutilizado no admin)
   ============================================================ */
.admin-sidebar {
    background: linear-gradient(180deg, #000B1F 0%, #1a3350 50%, #546D8B 100%);
    min-height: 100vh;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.18s;
    text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* ============================================================
   Responsividade complementar
   ============================================================ */
@media (max-width: 640px) {
    .matrix-table { font-size: 0.75rem; }
    .matrix-table th { padding: 10px 8px; }
    .matrix-table td { padding: 10px 8px; }
}

/* ============================================================
   Botão Flutuante de Ajuda (acima do e-mail)
   ============================================================ */
.float-help-btn {
    position: fixed !important;
    bottom: 96px !important;
    right: 28px !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px;
    height: 52px;
    background: #F76301 !important;
    color: #fff !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(247, 99, 1, 0.45), 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 1.3rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    animation: floatHelpPulse 3s ease-in-out infinite;
}

.float-help-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 28px rgba(247, 99, 1, 0.55), 0 4px 14px rgba(0, 0, 0, 0.2);
    animation: none;
}

.float-help-btn:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes floatHelpPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(247, 99, 1, 0.45), 0 2px 6px rgba(0, 0, 0, 0.15); }
    50%       { box-shadow: 0 6px 24px rgba(247, 99, 1, 0.65), 0 3px 10px rgba(0, 0, 0, 0.2); }
}

@media (max-width: 640px) {
    .float-help-btn {
        bottom: 82px !important;
        right: 16px !important;
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }
}

/* ============================================================
   Botão Flutuante de E-mail
   ============================================================ */
.float-email-btn {
    position: fixed !important;
    bottom: 28px !important;
    right: 28px !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    background: linear-gradient(135deg, #000B1F 0%, #1a3350 50%, #546D8B 100%) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 50px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0, 11, 31, 0.45), 0 2px 8px rgba(0, 0, 0, 0.18);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                padding 0.3s ease,
                max-width 0.4s ease;
    animation: floatEmailPulse 3s ease-in-out infinite;
    overflow: hidden;
    max-width: 56px;
    flex-shrink: 0;
    flex-grow: 0;
}

.float-email-btn .float-email-label {
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-width 0.4s ease;
}

.float-email-btn i {
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.float-email-btn:hover {
    max-width: 240px;
    padding: 14px 24px;
    box-shadow: 0 8px 32px rgba(0, 11, 31, 0.5), 0 4px 16px rgba(247, 99, 1, 0.3);
    transform: translateY(-4px);
    animation: none;
}

.float-email-btn:hover .float-email-label {
    opacity: 1;
    max-width: 160px;
}

.float-email-btn:hover i {
    transform: rotate(-15deg) scale(1.15);
}

@keyframes floatEmailPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 11, 31, 0.45), 0 2px 8px rgba(0, 0, 0, 0.18); }
    50%       { box-shadow: 0 6px 28px rgba(247, 99, 1, 0.55), 0 3px 12px rgba(0, 0, 0, 0.22); }
}

@media (max-width: 640px) {
    .float-email-btn {
        bottom: 20px !important;
        right: 16px !important;
        width: 52px;
        height: 52px;
        max-width: 52px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
    .float-email-btn .float-email-label {
        display: none;
    }
    .float-email-btn:hover {
        max-width: 52px;
        padding: 0;
    }
}

/* ============================================================
   E-book Download Card
   ============================================================ */
.ebook-download-card {
    animation: fadeIn 0.4s ease forwards;
}

.ebook-btn-download {
    background: linear-gradient(135deg, #F76301 0%, #e55a00 50%, #cc5000 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(247, 99, 1, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.ebook-btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ebook-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 99, 1, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.ebook-btn-download:hover::before {
    left: 100%;
}

.ebook-btn-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(247, 99, 1, 0.3);
}
