/* ===============================================
   Server Monitoring Dashboard Styles
   RealmHost Admin Panel
   =============================================== */

/* Main Container */
.monitoring-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    padding: calc(var(--header-height) + 2rem) 1.5rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Sidebar */
.monitoring-sidebar {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.light-mode .monitoring-sidebar {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
}

/* Server Selector */
.server-selector h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.server-selector h3 i {
    width: 16px;
    height: 16px;
}

.server-selector .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Server Status Card */
.server-status-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
}

.light-mode .server-status-card {
    background: rgba(241, 245, 249, 0.6);
    border: 1px solid var(--border-light);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .status-header {
    border-bottom: 1px solid var(--border-light);
}

.status-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: pulse-online 2s infinite;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.status-dot.starting {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    animation: pulse-starting 1s infinite;
}

@keyframes pulse-online {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
    }
}

@keyframes pulse-starting {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.status-text.online {
    color: #10b981;
}

.status-text.offline {
    color: #ef4444;
}

.status-text.starting {
    color: #f59e0b;
}

.status-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.status-detail-row span:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.status-detail-row span:first-child i {
    width: 14px;
    height: 14px;
}

.status-detail-row span:last-child {
    font-weight: 500;
    color: var(--text-main);
}

/* Control Panel */
.control-panel h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn i {
    width: 16px;
    height: 16px;
}

.control-btn.start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.control-btn.start:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.control-btn.restart {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.control-btn.restart:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.control-btn.stop {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.control-btn.stop:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.control-btn.kill {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.control-btn.kill:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 0.75rem;
}

.quick-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.light-mode .quick-stat {
    background: rgba(241, 245, 249, 0.6);
    border: 1px solid var(--border-light);
}

.quick-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-stat-icon i {
    width: 18px;
    height: 18px;
}

.quick-stat-icon.cpu {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(79, 70, 229, 0.1));
    color: var(--primary);
}

.quick-stat-icon.ram {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(14, 165, 233, 0.1));
    color: var(--secondary);
}

.quick-stat-info {
    display: flex;
    flex-direction: column;
}

.quick-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.quick-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Sidebar Navigation */
.monitoring-sidebar .sidebar-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    margin-top: auto;
}

.light-mode .monitoring-sidebar .sidebar-nav {
    border-top: 1px solid var(--border-light);
}

/* Main Content */
.monitoring-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem;
}

.light-mode .chart-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-title i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.chart-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chart-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.chart-container {
    height: 200px;
    position: relative;
}

/* Console Card */
.console-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
}

.light-mode .console-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .console-header {
    border-bottom: 1px solid var(--border-light);
}

.console-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.console-title i {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.console-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.console-actions {
    display: flex;
    gap: 0.5rem;
}

.console-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.console-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.console-action-btn.active {
    background: var(--primary);
    color: white;
}

.console-action-btn i {
    width: 16px;
    height: 16px;
}

/* Terminal */
.console-terminal {
    background: #0f172a;
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.light-mode .console-terminal {
    background: #1e293b;
}

/* Custom Scrollbar for Terminal */
.console-terminal::-webkit-scrollbar {
    width: 8px;
}

.console-terminal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.console-terminal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.console-terminal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.console-line {
    padding: 2px 0;
    word-break: break-all;
}

.console-line.info {
    color: #94a3b8;
}

.console-line.success {
    color: #10b981;
}

.console-line.warning {
    color: #f59e0b;
}

.console-line.error {
    color: #ef4444;
}

.console-line.command {
    color: #818cf8;
}

.console-line.player {
    color: #0ea5e9;
}

/* Console Input */
.console-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.light-mode .console-input-wrapper {
    background: #f1f5f9;
    border-top: 1px solid var(--border-light);
}

.console-prompt {
    color: var(--accent);
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    outline: none;
}

.console-input::placeholder {
    color: var(--text-muted);
}

.console-send-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.console-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.console-send-btn i {
    width: 16px;
    height: 16px;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mini-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.light-mode .mini-stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
}

.mini-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(14, 165, 233, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.mini-stat-icon i {
    width: 22px;
    height: 22px;
}

.mini-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mini-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.mini-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .monitoring-container {
        grid-template-columns: 1fr;
    }

    .monitoring-sidebar {
        position: relative;
        top: 0;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .monitoring-container {
        padding: calc(var(--header-height) + 1rem) 1rem 1rem;
    }

    .control-buttons {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        flex-direction: column;
    }

    .console-terminal {
        height: 250px;
    }
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
