/* ===================== SERVERS PAGE STYLES ===================== */

/* Page Layout */
.servers-page {
    padding: 0;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.stats-cards {
    display: flex;
    gap: 15px;
    flex: 1;
}

/* Stat Box */
.stat-box {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 220px;
    position: relative;
    overflow: hidden;
}

.stat-icon-wrap {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon-wrap.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.stat-icon-wrap.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-icon-wrap.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.stat-number span {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 5px;
}

.stat-mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
}

.stat-mini-chart .mini-bar {
    width: 6px;
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    border-radius: 2px;
}

.stat-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.stat-progress .progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.stat-progress .progress-fill.green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-progress .progress-fill.red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-badge {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
}

.stat-badge.green { color: rgba(16, 185, 129, 0.3); }
.stat-badge.red { color: rgba(239, 68, 68, 0.3); }

/* Top Actions */
.top-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.btn-add {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 8px 15px;
    gap: 10px;
}

.search-wrapper i {
    color: rgba(255, 255, 255, 0.4);
}

.search-wrapper input {
    background: none;
    border: none;
    color: white;
    outline: none;
    width: 120px;
}

.search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-select {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 8px 15px;
    color: white;
    cursor: pointer;
}

.tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.tool-btn.with-text {
    width: auto;
    padding: 8px 15px;
    gap: 8px;
}

.tool-btn.with-text span {
    font-size: 13px;
}

.view-btns {
    display: flex;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover, .view-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Server Card Expanded */
.server-card {
    background: linear-gradient(135deg, #111827 0%, #0a0f1a 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 16px;
    margin-bottom: 15px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.server-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.server-icon-box {
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 20px;
}

.server-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.server-specs {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.server-specs i {
    margin-right: 5px;
    color: #3b82f6;
}

.server-meta {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 12px;
}

.server-ip {
    color: rgba(255, 255, 255, 0.4);
}

.server-proc {
    color: rgba(255, 255, 255, 0.4);
}

.server-proc i {
    color: #10b981;
    font-size: 8px;
    margin-right: 5px;
}

.server-resources {
    display: flex;
    gap: 15px;
}

.server-resources span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.server-resources i {
    color: #3b82f6;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.metric-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

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

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.bar-fill.cpu { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.disk { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.bar-fill.freq { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.bar-fill.ram { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.net { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

.metric-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.metric-info .percent {
    color: white;
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.action-btn.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.action-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: white;
}

.action-btn.dropdown {
    padding-right: 12px;
}

.action-btn i.fa-chevron-down {
    font-size: 10px;
    margin-left: 5px;
}

/* Chart Section */
.chart-section {
    padding: 15px 25px 20px;
}

.chart-header {
    margin-bottom: 10px;
}

.chart-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
}

.chart-stats .stat {
    color: rgba(255, 255, 255, 0.6);
}

.chart-stats .stat.cpu {
    color: #f59e0b;
    font-weight: 600;
}

.chart-stats .stat.io {
    color: rgba(255, 255, 255, 0.5);
}

.chart-stats .stat-bar {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.chart-stats .stat-bar.orange { background: #f59e0b; }
.chart-stats .stat-bar.blue { background: #3b82f6; }

.chart-stats .expand-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.chart-timeline {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.chart-timeline .active {
    color: white;
}

.chart-timeline .dot-live {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.chart-graph {
    height: 80px;
    position: relative;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

/* Server Row (Minimized) */
.server-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #111827 0%, #0a0f1a 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.server-row:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.row-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.row-icon.online {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.row-icon.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.row-name {
    font-weight: 500;
    color: white;
}

.row-metrics {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 1;
    justify-content: center;
}

.mini-metric {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.mini-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.mini-bar-fill.cpu { background: #f59e0b; }
.mini-bar-fill.ram { background: #10b981; }
.mini-bar-fill.disk { background: #8b5cf6; }

.mini-metric span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 35px;
}

.mini-metric.net {
    gap: 8px;
}

.mini-metric.net i {
    color: #3b82f6;
}

.mini-metric .pct {
    color: white;
    font-weight: 500;
}

.row-expand {
    width: 32px;
    height: 32px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.row-expand:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Terminal */
.terminal-output {
    background: #0a0a0a;
    border-radius: 8px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    margin-bottom: 15px;
}

.terminal-output .line {
    margin-bottom: 5px;
    line-height: 1.5;
}

.terminal-output .line.cmd { color: #10b981; }
.terminal-output .line.cmd::before { content: '$ '; color: #3b82f6; }
.terminal-output .line.out { color: rgba(255, 255, 255, 0.7); white-space: pre-wrap; }
.terminal-output .line.err { color: #ef4444; }
.terminal-output .line.sys { color: #6366f1; font-style: italic; }

.terminal-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0a0a0a;
    border-radius: 8px;
    padding: 10px 15px;
}

.terminal-input-wrap .prompt {
    color: #3b82f6;
    font-family: monospace;
}

.terminal-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-family: monospace;
    font-size: 14px;
    outline: none;
}

.terminal-input-wrap button {
    background: #3b82f6;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
}

/* Status Badge */
.status-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 10px;
    vertical-align: middle;
}

.status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Server Icon Box Status */
.server-icon-box.online {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.server-icon-box.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Action Button Danger */
.action-btn.danger {
    color: #ef4444;
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Chart Stats */
.chart-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.chart-stats .stat.cpu { color: #f59e0b; }
.chart-stats .stat.ram { color: #10b981; }
.chart-stats .stat.disk { color: #8b5cf6; }
.chart-stats .stat.net { color: #3b82f6; }

/* Row IP */
.row-ip {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    display: block;
}

/* Mini Metric Label */
.mini-metric .label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    min-width: 35px;
}

/* Metric Title Icon */
.metric-title i {
    margin-right: 5px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .top-bar {
        flex-direction: column;
    }
    
    .stats-cards {
        width: 100%;
    }
    
    .stat-box {
        flex: 1;
        min-width: 0;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-cards {
        flex-direction: column;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .row-metrics {
        display: none;
    }
    
    .server-resources {
        display: none;
    }
}
