/* =====================================================
   CALENDÁRIO MILITAR V3 — TEMA ESCURO + TACTICAL SCARCITY
   Arquivo COMBINADO: substitui o calendar-v3-fullcalendar-styles.css
   original e já inclui as adições da versão Tactical (barras animadas,
   badges de escassez, shimmer, glow pulsante).
   ===================================================== */

/* =====================================================
   WRAPPER E STATUS
   ===================================================== */
.calendar-military-wrapper {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.operation-status {
    position: absolute;
    top: -15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(231, 111, 81, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #2ECC71;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.status-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-family: 'Courier New', Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================================================
   FULLCALENDAR - TEMA ESCURO/MILITAR (mantido do original)
   ===================================================== */

#fullcalendar-container { background: transparent; }

.fc { background: transparent !important; }

.fc-theme-standard td,
.fc-theme-standard th { border-color: rgba(255, 255, 255, 0.1) !important; }

.fc-theme-standard .fc-scrollgrid { border-color: rgba(255, 255, 255, 0.1) !important; }

.fc .fc-col-header-cell {
    background: rgba(26, 26, 46, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.fc .fc-col-header-cell-cushion {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 12px 8px !important;
    text-decoration: none !important;
}

.fc .fc-col-header-cell:hover { background: rgba(26, 26, 46, 0.95) !important; }

.fc .fc-daygrid-day {
    background: rgba(255, 255, 255, 0.03) !important;
    transition: background 0.2s ease !important;
    min-height: 80px !important;
}

.fc .fc-daygrid-day:hover { background: rgba(255, 255, 255, 0.08) !important; }

.fc .fc-daygrid-day-number {
    color: #ecf0f1 !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    padding: 4px 8px !important;
}

.fc .fc-day-today { background: rgba(231, 111, 81, 0.1) !important; }

.fc .fc-day-today .fc-daygrid-day-number {
    color: #E76F51 !important;
    font-weight: 700 !important;
}

.fc .fc-day-other { background: rgba(0, 0, 0, 0.2) !important; }

.fc .fc-day-other .fc-daygrid-day-number { color: rgba(255, 255, 255, 0.3) !important; }

/* =====================================================
   EVENTOS - BARRAS DE CURSOS (base)
   ===================================================== */

.fc-event {
    border: none !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin: 1px 2px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.fc-event:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
    filter: brightness(1.1) !important;
    z-index: 100 !important;
}

.fc-event-main { padding: 2px 4px !important; }
.fc-daygrid-event .fc-event-main { padding: 4px 6px !important; }

.fc-daygrid-event-dot { display: none !important; }

.calendar-event-content { color: white !important; }
.calendar-event-content .event-title { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

/* =====================================================
   BORDA LATERAL POR STATUS (mantida do original)
   ===================================================== */

.fc-event[style*="rgb(46, 204, 113)"],
.fc-event[style*="#2ECC71"],
.fc-event[style*="#2ecc71"] { border-left: 3px solid #27AE60 !important; }

.fc-event[style*="rgb(243, 156, 18)"],
.fc-event[style*="#F39C12"],
.fc-event[style*="#f39c12"] { border-left: 3px solid #E67E22 !important; }

.fc-event[style*="rgb(149, 165, 166)"],
.fc-event[style*="#95A5A6"],
.fc-event[style*="#95a5a6"] { border-left: 3px solid #7F8C8D !important; opacity: 0.8 !important; }

/* Tactical: borda vermelha pra critical */
.fc-event[style*="rgb(192, 57, 43)"],
.fc-event[style*="#C0392B"],
.fc-event[style*="#c0392b"] { border-left: 3px solid #962D22 !important; }

/* =====================================================
   MAIS EVENTOS (+more) — mantido do original
   ===================================================== */

.fc .fc-daygrid-more-link {
    color: #F39C12 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

.fc .fc-daygrid-more-link:hover { color: #E76F51 !important; }

.fc .fc-more-popover {
    background: #1a1a2e !important;
    border: 1px solid rgba(231, 111, 81, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.fc .fc-more-popover .fc-popover-header {
    background: rgba(231, 111, 81, 0.1) !important;
    color: #E76F51 !important;
}

.fc .fc-more-popover .fc-popover-body { background: #1a1a2e !important; }

/* =====================================================
   TACTICAL — CONTEÚDO INTERNO DO EVENTO
   ===================================================== */
.calendar-event-content.tactical {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    color: #fff;
    overflow: hidden;
    line-height: 1.1;
}

.tactical-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.tactical-row-title { justify-content: space-between; }

.tactical-row-title .event-title {
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.2px;
}

/* =====================================================
   TACTICAL — BARRA DE OCUPAÇÃO
   ===================================================== */
.tactical-row-bar { gap: 6px; }

.vagas-bar {
    position: relative;
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.vagas-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 6px;
    transition: width 1100ms cubic-bezier(0.22, 1, 0.36, 1);
    background: linear-gradient(90deg, #2ECC71 0%, #27AE60 100%);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.5);
}

.vagas-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 35%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 65%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: tactical-shimmer 5s linear infinite;
    pointer-events: none;
}

.vagas-pct {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   TACTICAL — ESTADOS POR STATUS DE OCUPAÇÃO
   ===================================================== */

.calendar-event-content.status-available .vagas-fill {
    background: linear-gradient(90deg, #2ECC71 0%, #27AE60 100%);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.4);
}

.calendar-event-content.status-limited .vagas-fill {
    background: linear-gradient(90deg, #F39C12 0%, #E67E22 100%);
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.55);
}
.calendar-event-content.status-limited .vagas-shimmer { animation-duration: 4s; }

.calendar-event-content.status-critical .vagas-fill {
    background: linear-gradient(90deg, #E74C3C 0%, #C0392B 100%);
    animation: tactical-glow-pulse 2s ease-in-out infinite;
}
.calendar-event-content.status-critical .vagas-shimmer { animation-duration: 3s; }

.calendar-event-content.status-full { opacity: 0.78; }
.calendar-event-content.status-full .vagas-fill {
    background: linear-gradient(90deg, #7F8C8D 0%, #566573 100%);
    box-shadow: none;
}
.calendar-event-content.status-full .vagas-shimmer { display: none; }

/* =====================================================
   TACTICAL — BADGES DE ESCASSEZ
   ===================================================== */
.scarcity-badge {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    flex-shrink: 0;
    line-height: 1.2;
}

.badge-limited {
    background: rgba(243, 156, 18, 0.22);
    color: #FFD18C;
    border: 1px solid rgba(243, 156, 18, 0.5);
}

.badge-critical {
    background: rgba(231, 76, 60, 0.28);
    color: #FFB3AC;
    border: 1px solid rgba(231, 76, 60, 0.65);
    animation: tactical-badge-pulse 1.4s ease-in-out infinite;
}

.badge-full {
    background: rgba(127, 140, 141, 0.25);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(127, 140, 141, 0.5);
}

/* =====================================================
   KEYFRAMES TÁTICOS
   ===================================================== */
@keyframes tactical-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes tactical-glow-pulse {
    0%, 100% {
        box-shadow:
            0 0 6px rgba(231, 76, 60, 0.55),
            0 0 0 0 rgba(231, 76, 60, 0.45);
    }
    50% {
        box-shadow:
            0 0 14px rgba(231, 76, 60, 0.85),
            0 0 18px 2px rgba(231, 76, 60, 0.35);
    }
}

@keyframes tactical-badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.55);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(231, 76, 60, 0);
    }
}

/* =====================================================
   RESPONSIVIDADE — mantida do original + ajustes tactical
   ===================================================== */

@media (max-width: 768px) {
    .calendar-military-wrapper { padding: 10px; border-radius: 8px; }
    .operation-status { top: -12px; right: 10px; padding: 6px 12px; font-size: 0.75rem; }
    .fc .fc-col-header-cell-cushion { font-size: 0.7rem !important; padding: 8px 4px !important; letter-spacing: 0 !important; }
    .fc .fc-daygrid-day { min-height: 60px !important; }
    .fc .fc-daygrid-day-number { font-size: 0.75rem !important; padding: 2px 4px !important; }
    .fc-event { font-size: 0.65rem !important; margin: 1px !important; }

    .tactical-row-title .event-title { font-size: 0.7rem; }
    .scarcity-badge { font-size: 0.52rem; padding: 1px 4px; }
    .vagas-bar { height: 6px; }
    .vagas-pct { font-size: 0.58rem; min-width: 26px; }
}

@media (max-width: 480px) {
    .fc .fc-col-header-cell-cushion { font-size: 0.6rem !important; padding: 6px 2px !important; }
    .vagas-pct { display: none; }
    .scarcity-badge { display: none; }
}

/* =====================================================
   ACESSIBILIDADE — prefers-reduced-motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    .vagas-fill { transition: none; }
    .vagas-shimmer,
    .calendar-event-content.status-critical .vagas-fill,
    .badge-critical { animation: none; }
}

/* =====================================================
   OCULTAR ELEMENTOS NÃO USADOS / ESTADOS DE ERRO
   ===================================================== */

.calendar-events-overlay { display: none !important; }

.calendar-empty-state,
.calendar-error-state {
    text-align: center;
    padding: 60px 20px;
    color: #ecf0f1;
}

.empty-icon, .error-icon { font-size: 4rem; margin-bottom: 20px; }

.calendar-empty-state h3,
.calendar-error-state h3 { margin-bottom: 10px; font-size: 1.5rem; }

.calendar-empty-state p,
.calendar-error-state p { opacity: 0.7; margin-bottom: 20px; }
