/* -----------------------------------------------------------
   iREDHUB — DESIGN SYSTEM GLOBAL
   Compatibiliza todas as páginas com o estilo do create.blade
   Inclua este arquivo no base-layout.blade.php
   <link rel="stylesheet" href="{{ asset('css/ired-design-system.css') }}">
----------------------------------------------------------- */

/* -- CSS VARIABLES -- */
:root {
    --ired-bg:           #060818;
    --ired-card:         #0e101f;
    --ired-input:        #16192c;
    --ired-border:       rgba(255, 35, 37, 0.25);
    --ired-red:          #ff2325;
    --ired-red-hover:    #d21b1d;
    --ired-red-glow:     rgba(255, 35, 37, 0.15);
    --ired-green:        #00ab55;
    --ired-orange:       #ff9d00;
    --ired-cyan:         #00abff;
    --ired-muted:        #888ea8;
    --ired-text:         #e0e6ed;
    --ired-radius:       12px;
    --ired-radius-lg:    15px;
    --ired-font-head:    'Orbitron', sans-serif;
    --ired-glow-cyan:    rgba(0, 171, 255, 0.4);
    --ired-glow-red:     rgba(255, 35, 37, 0.4);
    --ired-glow-orange:  rgba(255, 157, 0, 0.4);
    --ired-glow-purple:  rgba(128, 90, 213, 0.4);
    --ired-transition:   0.25s ease;
}

/* -- BODY BASE -- */
body {
    background-color: var(--ired-bg) !important;
    color: var(--ired-text) !important;
}

/* -- SIDEBAR / LAYOUT OVERRIDES -- */
.sidebar-wrapper {
    background: #060818 !important;
    border-right: 1px solid rgba(255, 35, 37, 0.1) !important;
}
#content {
    background: var(--ired-bg) !important;
}

/* -- GLOBAL CARD OVERRIDE -- */
.card {
    background: var(--ired-card) !important;
    border: 1px solid var(--ired-border) !important;
    border-radius: var(--ired-radius-lg) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}
.card-header {
    background: rgba(255, 35, 37, 0.03) !important;
    border-bottom: 1px solid var(--ired-border) !important;
    font-family: var(--ired-font-head);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ired-text) !important;
}

/* -- FORM CONTROLS -- */
.form-control,
.form-select {
    background-color: var(--ired-input) !important;
    border: 1px solid rgba(255, 35, 37, 0.3) !important;
    color: var(--ired-text) !important;
    border-radius: 8px !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--ired-red) !important;
    box-shadow: 0 0 10px var(--ired-red-glow) !important;
    outline: none !important;
    background-color: var(--ired-input) !important;
    color: var(--ired-text) !important;
}
.form-control::placeholder { color: rgba(136, 142, 168, 0.5) !important; }
label {
    color: var(--ired-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* -- BUTTONS -- */
.btn-primary {
    background: var(--ired-red) !important;
    border-color: var(--ired-red) !important;
    font-family: var(--ired-font-head) !important;
    font-weight: 700 !important;
    transition: 0.3s !important;
}
.btn-primary:hover {
    background: var(--ired-red-hover) !important;
    border-color: var(--ired-red-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px var(--ired-red-glow) !important;
}
.btn-success {
    background: var(--ired-green) !important;
    border-color: var(--ired-green) !important;
    font-family: var(--ired-font-head) !important;
    font-weight: 700 !important;
}
.btn-danger {
    background: var(--ired-red) !important;
    border-color: var(--ired-red) !important;
    font-family: var(--ired-font-head) !important;
    font-weight: 700 !important;
}

/* -- TABLES -- */
.table {
    color: var(--ired-text) !important;
}
.table > :not(caption) > * > * {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}
.table-hover > tbody > tr:hover > * {
    background: rgba(255, 35, 37, 0.04) !important;
    color: var(--ired-text) !important;
}
.table thead th {
    color: var(--ired-muted) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    border: none !important;
}

/* -- BADGES -- */
.badge-light-danger  { background: rgba(255, 35, 37, 0.12) !important; color: #ff2325 !important; }
.badge-light-warning { background: rgba(255, 157, 0, 0.12) !important; color: #ff9d00 !important; }
.badge-light-success { background: rgba(0, 171, 85, 0.12)  !important; color: #00ab55 !important; }
.badge-light-info    { background: rgba(0, 171, 255, 0.12) !important; color: #00abff !important; }

/* -- ALERTS -- */
.alert-light-danger  { background: rgba(255, 35, 37, 0.08) !important; border-left: 3px solid #ff2325 !important; border-radius: 10px !important; color: var(--ired-text) !important; }
.alert-light-warning { background: rgba(255, 157, 0, 0.08) !important; border-left: 3px solid #ff9d00 !important; border-radius: 10px !important; color: var(--ired-text) !important; }
.alert-success       { background: rgba(0, 171, 85, 0.08)  !important; border-left: 3px solid #00ab55 !important; border-radius: 10px !important; color: var(--ired-text) !important; }

/* -- MODALS -- */
.modal-content {
    background: var(--ired-card) !important;
    border: 1px solid var(--ired-border) !important;
    border-radius: var(--ired-radius-lg) !important;
}
.modal-header {
    border-bottom: 1px solid var(--ired-border) !important;
    background: rgba(255, 35, 37, 0.03) !important;
}
.modal-footer {
    border-top: 1px solid var(--ired-border) !important;
    background: rgba(255, 35, 37, 0.02) !important;
}

/* -- NOTE COMPONENT -- */
.note {
    border-radius: 10px !important;
    border-left: 3px solid var(--ired-red) !important;
    background: rgba(255, 35, 37, 0.04) !important;
}
.note-primary { border-color: var(--ired-cyan) !important; background: rgba(0, 171, 255, 0.04) !important; }

/* -- SCROLLBAR -- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--ired-bg); }
::-webkit-scrollbar-thumb { background: rgba(255, 35, 37, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ired-red); }

/* -- ORBITRON HEADINGS -- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ired-font-head), sans-serif;
}

/* -- INPUT GROUP -- */
.input-group-text {
    background: var(--ired-card) !important;
    border: 1px solid rgba(255, 35, 37, 0.3) !important;
    color: var(--ired-red) !important;
    border-radius: 8px 0 0 8px !important;
}

/* -- DROPDOWN -- */
.dropdown-menu {
    background: var(--ired-card) !important;
    border: 1px solid var(--ired-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}
.dropdown-item {
    color: var(--ired-text) !important;
    font-size: 13px;
    transition: 0.2s;
}
.dropdown-item:hover {
    background: rgba(255, 35, 37, 0.08) !important;
    color: var(--ired-red) !important;
}

/* -- PAGINATION -- */
.page-link {
    background: var(--ired-card) !important;
    border: 1px solid var(--ired-border) !important;
    color: var(--ired-muted) !important;
    transition: 0.2s !important;
}
.page-link:hover {
    background: rgba(255, 35, 37, 0.1) !important;
    color: var(--ired-red) !important;
    border-color: var(--ired-red) !important;
}
.page-item.active .page-link {
    background: var(--ired-red) !important;
    border-color: var(--ired-red) !important;
    color: #fff !important;
}

/* -- LOADER OVERRIDE -- */
#load_screen { background: var(--ired-bg) !important; }

/* -- BUTTON HOVER PREMIUM -- */
.btn {
    transition: transform var(--ired-transition), box-shadow var(--ired-transition), filter var(--ired-transition) !important;
}
.btn:hover {
    transform: scale(1.05) !important;
    filter: saturate(1.1) !important;
}
.btn-primary:hover {
    box-shadow: 0 0 18px var(--ired-glow-red) !important;
}
.btn-success:hover {
    box-shadow: 0 0 18px rgba(0, 171, 85, 0.4) !important;
}
.btn-info:hover {
    box-shadow: 0 0 18px var(--ired-glow-cyan) !important;
}

/* -- APEXCHARTS TOOLTIP PREMIUM -- */
.apexcharts-tooltip {
    background: rgba(14, 16, 31, 0.92) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 171, 255, 0.3) !important;
    border-radius: 10px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 171, 255, 0.15) !important;
    color: var(--ired-text) !important;
}
.apexcharts-tooltip .apexcharts-tooltip-title {
    background: rgba(0, 171, 255, 0.06) !important;
    border-bottom: 1px solid rgba(0, 171, 255, 0.15) !important;
    color: var(--ired-cyan) !important;
    font-weight: 700 !important;
}
.apexcharts-tooltip .apexcharts-tooltip-series-group {
    background: transparent !important;
}
.apexcharts-tooltip .apexcharts-tooltip-y-group .apexcharts-tooltip-text-y-value {
    color: #fff !important;
    font-weight: 800 !important;
}

/* -- REDUCED MOTION -- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* -----------------------------------------------------------
   iREDHUB — GLASS CARD OVERRIDES
   Garante que .glass-card sempre vença o .card genérico
----------------------------------------------------------- */

/* Especificidade maior que .card para garantir glassmorphism */
.card.glass-card,
div.glass-card {
    background: rgba(10, 12, 28, 0.62) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(18px) saturate(1.4) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.05) !important;
    transition: transform .28s cubic-bezier(.25,.8,.25,1),
                box-shadow .28s cubic-bezier(.25,.8,.25,1),
                border-color .28s ease !important;
    position: relative;
    overflow: hidden;
}

/* Camada de glow reativa ao mouse */
.card.glass-card::after,
div.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity .35s ease;
    background: radial-gradient(
        500px circle at var(--mx, 50%) var(--my, 50%),
        var(--glow-color, rgba(0, 171, 255, 0.12)),
        transparent 55%
    );
    pointer-events: none;
}
.card.glass-card:hover::after,
div.glass-card:hover::after { opacity: 1; }

.card.glass-card > *,
div.glass-card > * { position: relative; z-index: 1; }

.card.glass-card:hover,
div.glass-card:hover {
    transform: translateY(-4px) scale(1.005) !important;
    border-color: rgba(0, 171, 255, 0.38) !important;
    box-shadow:
        0 0 0 1px rgba(0, 171, 255, 0.28),
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 28px rgba(0, 171, 255, 0.14) !important;
}

/* -- METRIC CARD ICONS -- */
.metric-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.metric-card-icon.cyan   { background: rgba(0,171,255,.12);  color: #00abff; box-shadow: 0 0 16px rgba(0,171,255,.2); }
.metric-card-icon.red    { background: rgba(255,35,37,.12);   color: #ff2325; box-shadow: 0 0 16px rgba(255,35,37,.2); }
.metric-card-icon.orange { background: rgba(255,157,0,.12);   color: #ff9d00; box-shadow: 0 0 16px rgba(255,157,0,.2); }
.metric-card-icon.purple { background: rgba(128,90,213,.12);  color: #805ad5; box-shadow: 0 0 16px rgba(128,90,213,.2); }

/* -- METRIC CARD TYPOGRAPHY -- */
.metric-cards-row .card h1 {
    font-weight: 800 !important;
    font-size: 2.2rem !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
    letter-spacing: .3px !important;
}
.metric-cards-row .card p {
    font-weight: 600 !important;
    color: #9aa6b2 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: .8px !important;
    margin-bottom: 0 !important;
}

/* -- CARD HEADER PREMIUM -- */
.glass-card .card-header {
    background: rgba(255,255,255,0.02) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
.glass-card .card-header h5 {
    font-family: 'Orbitron', sans-serif !important;
    font-size: 13px !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    color: #e0e6ed !important;
}

/* -- ANIMAÇÃO ENTRADA CARDS -- */
@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.metric-cards-row .col-6:nth-child(1) .glass-card { animation: cardFadeUp .45s ease both; }
.metric-cards-row .col-6:nth-child(2) .glass-card { animation: cardFadeUp .45s .08s ease both; }
.metric-cards-row .col-6:nth-child(3) .glass-card { animation: cardFadeUp .45s .16s ease both; }
.metric-cards-row .col-6:nth-child(4) .glass-card { animation: cardFadeUp .45s .24s ease both; }

/* -- REDUCED MOTION -- */
@media (prefers-reduced-motion: reduce) {
    .card.glass-card, div.glass-card,
    .card.glass-card::after, div.glass-card::after {
        animation: none !important;
        transition: none !important;
    }
}
