/* Resources page styles */

.resources-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Resource Cards */
.resource-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.resource-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.resource-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 10px;
    color: var(--primary);
    flex-shrink: 0;
}

.cpu-card .card-icon {
    color: var(--primary);
    background: var(--primary-light);
}
.memory-card .card-icon {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}
.disk-card .card-icon {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}
.network-card .card-icon {
    color: var(--primary);
    background: var(--primary-light);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.card-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
    margin-bottom: 0.5rem;
}

.card-value.warning {
    color: var(--warning);
}
.card-value.error {
    color: var(--error);
}

.progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.progress-fill.cpu {
    background: var(--primary);
}
.progress-fill.memory {
    background: var(--success);
}
.progress-fill.disk {
    background: var(--warning);
}

.card-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.network-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.net-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text);
}

.net-stat:first-child svg {
    color: var(--success);
}
.net-stat:last-child svg {
    color: var(--error);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.chart-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.chart-legend {
    display: flex;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-color.cpu {
    background: var(--primary);
}
.legend-color.system {
    background: var(--warning);
}
.legend-color.io {
    background: var(--error);
}
.legend-color.memory {
    background: var(--success);
}
.legend-color.cached {
    background: var(--primary);
}
.legend-color.buffers {
    background: var(--info);
}

.chart-container {
    padding: 1rem;
    min-height: 180px;
}

.chart-placeholder {
    position: relative;
    height: 150px;
}

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

.chart-axis-y {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.625rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

/* Detailed Section */
.detailed-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.detail-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.detail-header h3 svg {
    color: var(--primary);
}

.detail-header select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.detail-content {
    padding: 1rem 1.25rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Partition Rows */
.partition-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.partition-row:last-child {
    border-bottom: none;
}

.partition-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.partition-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
}

.partition-type {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.partition-usage {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 200px;
    margin-left: 1rem;
}

.usage-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.usage-fill.warning {
    background: var(--warning);
}
.usage-fill.error {
    background: var(--error);
}

.usage-text {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.process-table th,
.process-table td {
    padding: 0.625rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.process-table th {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.process-table td {
    font-size: 0.8125rem;
    color: var(--text);
}

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

.loading-row {
    text-align: center !important;
    color: var(--text-secondary) !important;
    padding: 2rem !important;
}

.process-status {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 500;
}

.process-status.running {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.process-status.sleeping {
    background: var(--primary-light);
    color: var(--primary);
}

.process-status.stopped {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Network Interfaces */
.interface-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.interface-row:last-child {
    border-bottom: none;
}

.interface-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.interface-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
}

.interface-ip {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.interface-stats {
    display: flex;
    gap: 1rem;
}

.stat-in,
.stat-out {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
    color: var(--text);
}

.stat-in svg {
    color: var(--success);
}
.stat-out svg {
    color: var(--error);
}

/* System Info */
.system-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
}

.system-info .info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.8125rem;
    color: var(--text);
    font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .resource-cards {
        grid-template-columns: 1fr 1fr;
    }

    .detailed-section {
        grid-template-columns: 1fr;
    }

    .partition-usage {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .resource-cards {
        grid-template-columns: 1fr;
    }

    .resource-card {
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        margin: 0 auto;
    }
}
