/* 
 * Watchtower Dashboard Style - PESARES Brand Refactor
 * Managed by @gemini_monster (UI Integration role)
 */

:root {
    --bg:       #0a0e1a;
    --panel:    #12121c;
    --line:     #2a2a3a;
    --text:     #e8e8ee;
    --muted:    #7a8599;
    --dim:      #555566;
    --teal:     #00c8a0;
    --teal-b:   #00e6b8;
    --red:      #e05555;
    --orange:   #f5a623;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow: hidden;
    min-height: 100vh;
}

/* PESARES Animated Background */
body::before {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    background:
        linear-gradient(rgba(0,200,160,.035) 1px, transparent 1px) 0 0 / 60px 60px,
        linear-gradient(90deg, rgba(0,200,160,.035) 1px, transparent 1px) 0 0 / 60px 60px;
    pointer-events: none;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: uppercase;
}

.logo span { color: var(--text); }
.logo .dot { color: var(--teal); }

.sidebar-nav {
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(0, 200, 160, 0.05);
    color: var(--text);
}

.nav-item.active {
    background-color: rgba(0, 200, 160, 0.1);
    color: var(--teal);
    border: 1px solid rgba(0, 200, 160, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 64px;
    background: rgba(18, 18, 28, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.topbar-search input {
    background-color: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    width: 300px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--teal);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-btn {
    background: rgba(0, 200, 160, 0.08);
    border: 1px solid var(--teal);
    color: var(--teal);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s;
}

.action-btn:hover {
    background: var(--teal-b);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 160, 0.3);
}

.user-profile .avatar {
    width: 32px;
    height: 32px;
    background: var(--teal);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--bg);
}

.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 32px;
    font-weight: 800;
    color: var(--text);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(0, 200, 160, 0.02);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(0, 200, 160, 0.08);
    transition: transform 0.4s ease, border-color 0.3s ease, box-shadow 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 200, 160, 0.4);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 200, 160, 0.06);
}

.stat-title {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.stat-value.warning { color: var(--orange); }
.stat-value.danger { color: var(--red); }
.stat-value.active { color: var(--teal); }

.stat-trend {
    font-size: 0.875rem;
}

.stat-trend.positive { color: var(--teal); }
.stat-trend.neutral { color: var(--muted); }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.card {
    background: rgba(0, 200, 160, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 200, 160, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-text {
    background: none;
    border: none;
    color: var(--teal);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-text:hover {
    color: var(--teal-b);
}

.card-body {
    padding: 0;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(0, 200, 160, 0.03);
}

.data-table tr:hover {
    background-color: rgba(0, 200, 160, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.online {
    background-color: rgba(0, 200, 160, 0.1);
    color: var(--teal);
}
.status-badge.online::before { background-color: var(--teal); }

.status-badge.offline {
    background-color: rgba(224, 85, 85, 0.1);
    color: var(--red);
}
.status-badge.offline::before { background-color: var(--red); }

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 48px !important;
}

/* =============================================================
   11. DASHBOARD v2 COMPONENTS (#55 Diferencijatori)
   ============================================================= */

/* SLA Scorecard Pills */
.sla-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sla-pill.green  { background: rgba(0, 200, 160, 0.1); color: var(--teal); border: 1px solid rgba(0, 200, 160, 0.2); }
.sla-pill.yellow { background: rgba(245, 166, 35, 0.1); color: var(--orange); border: 1px solid rgba(245, 166, 35, 0.2); }
.sla-pill.red    { background: rgba(224, 85, 85, 0.1); color: var(--red); border: 1px solid rgba(224, 85, 85, 0.2); }

/* Per-Domain BW Bar */
.bw-container {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bw-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bw-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 500;
}

.bw-domain { color: var(--text); }
.bw-value  { color: var(--muted); }

.bw-bar-bg {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.bw-bar-fill {
    height: 100%;
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bw-bar-fill.warning { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.bw-bar-fill.danger  { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* Load Map Grid */
.load-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* =============================================================
   12. NOC TV MODE
   ============================================================= */
#view-noctv {
    background-color: #050508;
    color: #fff;
    border-radius: 12px;
    padding: 40px;
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}
#view-noctv.active-noc-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    border-radius: 0;
    min-height: 100vh;
}
.noc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--teal);
    padding-bottom: 20px;
    margin-bottom: 40px;
}
.noc-header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--teal);
}
.noc-time {
    font-size: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.noc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
.noc-card {
    background: rgba(0, 200, 160, 0.05);
    border: 1px solid rgba(0, 200, 160, 0.2);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
}
.noc-card h2 {
    font-size: 1.5rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}
.noc-value {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
}
.noc-value.highlight {
    color: var(--teal-b);
    text-shadow: 0 0 20px rgba(0, 200, 160, 0.5);
}
.noc-map-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 300px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.noc-pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 0 rgba(0, 200, 160, 0.7);
    animation: noc-pulse 2s infinite;
}
@keyframes noc-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 160, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 30px rgba(0, 200, 160, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 200, 160, 0); }
}
.noc-ticker {
    position: absolute;
    bottom: 20px;
    width: 90%;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px dashed var(--dim);
    padding-top: 10px;
}
.noc-ticker ul {
    list-style: none;
    display: inline-block;
    animation: ticker 20s linear infinite;
    font-size: 1.2rem;
    color: var(--teal);
}
.noc-ticker li {
    display: inline-block;
    margin-right: 50px;
}
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* =============================================================
   13. RESPONSIVE DESIGN (MOBILE / TABLET)
   ============================================================= */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: column;
        border-right: none;
        border-bottom: 1px solid var(--line);
        flex-shrink: 0;
    }

    .sidebar-header {
        border-bottom: 1px solid rgba(0, 200, 160, 0.1);
        padding: 12px 16px;
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 8px 16px;
        overflow-x: auto;
        gap: 8px;
        /* Hide scrollbar for a cleaner look */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .topbar {
        height: auto;
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .topbar-search input {
        width: 100%;
    }

    .topbar-actions {
        justify-content: flex-end;
    }

    .dashboard-scroll {
        padding: 16px;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-header h2 {
        font-size: 1.1rem;
    }

    .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
        white-space: nowrap;
    }

    /* NOC TV adjustments */
    #view-noctv {
        padding: 20px;
    }
    .noc-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        margin-bottom: 20px;
    }
    .noc-header h1 { font-size: 1.5rem; }
    .noc-time { font-size: 1.2rem; }
    .noc-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    .noc-card { padding: 20px; }
    .noc-value { font-size: 3.5rem; }
    .noc-map-container { height: 200px; }
    .noc-ticker li { font-size: 1rem; margin-right: 30px; }
}
