/* base.css — Global styles extracted from base.html */

:root {
    --window-opacity: 0.99;
    --accent-color: #8b5cf6;
    --accent-rgb: 139, 92, 246;
    --bg-rgb: 15, 15, 25;
}

html[data-theme="light"] {
    --bg-rgb: 255, 255, 255;
}

/* Health footer badge backgrounds */
.health-badge-accent {
    background: rgba(var(--accent-rgb), 0.15);
}
.health-badge-healthy {
    background: rgba(16, 185, 129, 0.15);
}
.health-badge-warn {
    background: rgba(245, 158, 11, 0.15);
}
.health-badge-sos {
    background: rgba(239, 68, 68, 0.15);
}

html[data-theme="light"] .health-badge-accent {
    background: rgba(var(--accent-rgb), 0.3);
}
html[data-theme="light"] .health-badge-healthy {
    background: rgba(5, 150, 105, 0.3);
}
html[data-theme="light"] .health-badge-warn {
    background: rgba(217, 119, 6, 0.3);
}
html[data-theme="light"] .health-badge-sos {
    background: rgba(220, 38, 38, 0.3);
}

html[data-theme="light"] .health-badge-healthy span:last-child {
    color: #059669;
}
html[data-theme="light"] .health-badge-warn span:last-child {
    color: #d97706;
}
html[data-theme="light"] .health-badge-sos span:last-child {
    color: #dc2626;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    position: relative;
}

html[data-theme="dark"] body {
    background: #000000;
    color: #ffffff;
}

html[data-theme="light"] body {
    background: #ffffff;
    color: #000000;
}

/* Hide scrollbars but keep scrolling functionality */
::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Utility classes */
.d-none {
    display: none !important;
}

/* Button styling */
.btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.btn:active {
    opacity: 0.8;
}

.btn-ghost:hover {
    background-color: transparent !important;
}

/* Apple liquid glass style for active menu items */
.btn-ghost.btn-active {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

html[data-theme="dark"] .btn-ghost.btn-active {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="light"] .btn-ghost.btn-active {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

/* Table styling */
.table {
    background: transparent !important;
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

.table thead {
    background: transparent !important;
}

.table th,
.table td {
    background: transparent !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid;
    border-bottom: none !important;
    border-color: rgba(var(--accent-rgb), 0.2);
    padding: 0.75rem !important;
    vertical-align: middle;
    font-size: 0.875rem;
}

.table thead th {
    border-bottom: 1px solid;
    border-color: rgba(var(--accent-rgb), 0.3);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background-color: rgba(var(--accent-rgb), 0.05) !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Badge styling */
.badge-primary {
    background: rgba(var(--accent-rgb), 0.2) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(var(--accent-rgb), 0.3) !important;
    box-shadow:
        0 2px 4px -1px rgba(var(--accent-rgb), 0.2),
        0 1px 2px -1px rgba(var(--accent-rgb), 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

html[data-theme="dark"] .badge-primary {
    background: rgba(var(--accent-rgb), 0.15) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.25) !important;
}

html[data-theme="light"] .badge-primary {
    background: rgba(var(--accent-rgb), 0.25) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.35) !important;
}

/* Card styling */
.card {
    background: transparent !important;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

html[data-theme="dark"] .card {
    background: rgba(10, 10, 10, 0.8) !important;
}

html[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Input styling */
.input, .select, .textarea {
    background: transparent !important;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

html[data-theme="dark"] .input, html[data-theme="dark"] .select, html[data-theme="dark"] .textarea {
    background: rgba(10, 10, 10, 0.3) !important;
}

html[data-theme="light"] .input, html[data-theme="light"] .select, html[data-theme="light"] .textarea {
    background: rgba(243, 244, 246, 0.3) !important;
}

/* Modal styling */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-box {
    background: transparent !important;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}

html[data-theme="dark"] .modal-box {
    background: rgba(10, 10, 10, 0.95) !important;
}

html[data-theme="light"] .modal-box {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Status badges */
.status-online {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.status-offline {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.status-unknown {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.status-lockdown {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    font-weight: 600;
}

/* Alert styling */
.alert {
    border-radius: 8px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.alert-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Nav tabs */
.nav-tab {
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.nav-tab:hover {
    color: var(--accent-color);
}

/* Theme toggle button */
.theme-toggle {
    width: 46px;
    height: 32px;
    min-height: 32px;
    min-width: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background-color 0.15s ease;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Sidebar styling */
:root {
    --sidebar-width: 16rem;
    --sidebar-padding: 1rem;
    --sidebar-text-padding: 0;
    --logo-size: 1.5rem;
    --sidebar-bg: rgba(10, 10, 10, 1);
    --sidebar-border: 1px solid rgba(255, 255, 255, 0.1);
    --sidebar-shadow: 2px 0 8px rgba(0, 0, 0, 0.3), 1px 0 2px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] {
    --sidebar-bg: rgba(243, 244, 246, 1);
    --sidebar-border: 1px solid rgba(0, 0, 0, 0.1);
    --sidebar-shadow: 2px 0 8px rgba(0, 0, 0, 0.1), 1px 0 2px rgba(0, 0, 0, 0.05);
}

html[data-sidebar-collapsed="true"] {
    --sidebar-width: 4rem;
    --sidebar-padding: 1rem 0.5rem;
    --sidebar-text-padding: 0;
    --logo-size: 1.25rem;
}

.sidebar-container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    background-color: var(--sidebar-bg);
    width: var(--sidebar-width);
    padding: var(--sidebar-padding);
    padding-top: 1rem;
    transition: width 0.3s ease, padding 0.3s ease;
    -webkit-transition: width 0.3s ease, padding 0.3s ease;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
    -webkit-box-shadow: var(--sidebar-shadow);
    display: flex;
    flex-direction: column;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    width: 100%;
    text-transform: none;
}

html[data-theme="light"] .sidebar-menu-item {
    color: rgba(0, 0, 0, 0.7);
}

.sidebar-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

html[data-theme="light"] .sidebar-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--accent-color);
}

html[data-theme="dark"] .sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="light"] .sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.sidebar-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.sidebar-icon-sm {
    width: 0.875rem;
    height: 0.875rem;
    margin-left: auto;
    transition: transform 0.2s;
}

.sidebar-menu-text {
    opacity: 1;
    width: auto;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.2s ease;
    white-space: nowrap;
    display: inline-block;
}

html[data-sidebar-collapsed="true"] .sidebar-menu-text {
    opacity: 0;
    width: 0;
}

.sidebar-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

html[data-sidebar-collapsed="true"] .sidebar-badge {
    display: none;
}

.sidebar-menu-group {
    margin-bottom: 0.5rem;
}

.sidebar-submenu {
    display: none;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-submenu-item {
    opacity: 0.8;
}

.sidebar-submenu-item:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .sidebar-submenu-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-submenu-item.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--accent-color);
}

html[data-theme="light"] .sidebar-submenu-item.active {
    background: rgba(0, 0, 0, 0.1) !important;
}

.sidebar-logo-text {
    opacity: 1;
    transition: opacity 0.2s ease;
}

html[data-sidebar-collapsed="true"] .sidebar-logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Page transitions */
body {
    opacity: 1;
    transition: opacity 0.15s ease-out;
}

body.page-transition-out {
    opacity: 0;
}

/* Fade in on page load */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-content {
    animation: fadeIn 0.2s ease-out;
}

/* Country flag image */
.country-flag {
    display: inline-block;
    width: 18px;
    height: auto;
    vertical-align: -2px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Tab content transitions */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.tab-content.active {
    display: block;
    opacity: 1;
}
