/**
 * FTA Monitor - Glassmorphism Styles
 * Apple-inspired dark theme with blur effects
 */

/* ==========================================
   Base Styles & Variables
   ========================================== */

:root {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #0f3460;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --status-healthy: #22c55e;
    --status-warning: #eab308;
    --status-critical: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

/* ==========================================
   Background Gradient
   ========================================== */

.bg-gradient-main {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
}

/* ==========================================
   Glassmorphism Cards
   ========================================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

.glass-sidebar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
}

/* ==========================================
   Input Fields
   ========================================== */

.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* ==========================================
   Select/Dropdown Styling
   ========================================== */

select.input-field {
    background-color: rgba(30, 30, 50, 0.95);
    color: #ffffff;
    cursor: pointer;
}

select.input-field option {
    background-color: rgba(30, 30, 50, 0.98);
    color: #ffffff;
    padding: 12px 16px;
}

select.input-field option:hover,
select.input-field option:focus {
    background-color: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

select.input-field option:checked {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
    color: #ffffff;
}

select.input-field option:disabled {
    color: #6b7280;
}

/* ==========================================
   Buttons
   ========================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    font-weight: 500;
    font-size: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ==========================================
   Navigation
   ========================================== */

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* ==========================================
   Status Elements
   ========================================== */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Status Banners */
.status-banner {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.status-banner.status-healthy {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.15);
}

.status-banner.status-healthy .status-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-banner.status-warning {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.15);
}

.status-banner.status-warning .status-icon {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.status-banner.status-critical {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
    animation: glow-critical 2s ease-in-out infinite alternate;
}

.status-banner.status-critical .status-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@keyframes glow-critical {
    from {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    }
    to {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
    }
}

/* Large Status Banner for Overview */
.status-banner-large {
    display: flex;
    align-items: center;
    padding: 24px 32px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.status-banner-large.status-healthy {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-banner-large.status-healthy .status-icon-large {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

.status-banner-large.status-warning {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(234, 179, 8, 0.05) 100%);
    border: 1px solid rgba(234, 179, 8, 0.3);
    box-shadow: 0 0 60px rgba(234, 179, 8, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-banner-large.status-warning .status-icon-large {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.3);
}

.status-banner-large.status-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: glow-critical-large 2s ease-in-out infinite alternate;
}

.status-banner-large.status-critical .status-icon-large {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

@keyframes glow-critical-large {
    from {
        box-shadow: 0 0 40px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    to {
        box-shadow: 0 0 80px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

.status-icon-large {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Metric Icons
   ========================================== */

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Progress Bars
   ========================================== */

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

/* ==========================================
   Content Sections
   ========================================== */

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ==========================================
   Log Viewer
   ========================================== */

.log-viewer {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.log-viewer::-webkit-scrollbar {
    width: 8px;
}

.log-viewer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.log-line {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 12px;
    line-height: 1.5;
    color: #d1d5db;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-line.log-error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.log-line.log-warning {
    color: #fbbf24;
    background: rgba(234, 179, 8, 0.1);
}

.log-line.log-info {
    color: #60a5fa;
}

.log-line.log-debug {
    color: #9ca3af;
}

/* ==========================================
   Modal Styles
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    margin: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   Server Cards
   ========================================== */

.server-card {
    transition: all 0.3s ease;
}

.server-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   Table Styles
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 500;
}

/* ==========================================
   Scrollbar Styles
   ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   Utility Classes
   ========================================== */

.capitalize {
    text-transform: capitalize;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
    .glass-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 40;
        border-right: none;
        border-top: 1px solid var(--glass-border);
    }

    .glass-sidebar nav {
        display: flex;
        overflow-x: auto;
        padding: 8px;
    }

    .glass-sidebar nav a {
        flex: 0 0 auto;
    }

    main {
        padding-bottom: 100px;
    }
}

/* ==========================================
   Loading Animation
   ========================================== */

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Skeleton Loading
   ========================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   Focus States for Accessibility
   ========================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ==========================================
   Selection Color
   ========================================== */

::selection {
    background: rgba(59, 130, 246, 0.4);
    color: white;
}

/* ==========================================
   Toast Notifications
   ========================================== */

.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.toast-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.toast-notification.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.toast-notification.toast-info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* ==========================================
   Disabled Button States
   ========================================== */

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
