/* web-content/internal/css/dashboard.css */

/* Base container - both environments */
.dashboard-container,
.hpc-dashboard .dashboard-container {
    max-width: 1140px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Access control messages */
.access-message,
.hpc-dashboard .access-message {
    max-width: 1140px;
    margin: 2rem auto;
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.access-message h2,
.hpc-dashboard .access-message h2 {
    color: var(--tu-dark-blue);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.access-message p,
.hpc-dashboard .access-message p {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Loading indicator */
.loading-spinner,
.hpc-dashboard .loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin: 1rem auto;
    border: 3px solid var(--tu-teal);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Classic Dashboard Styles */
.overview-cards,
.hpc-dashboard .overview-cards {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    height: 400px;
}

#usage-chart,
.hpc-dashboard #usage-chart {
    height: 400px;
    position: relative;
}

#historyChart,
.hpc-dashboard #historyChart {
    max-height: 350px;
}


/* Stats Grid */
.stats-grid,
.hpc-dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.stat-item,
.hpc-dashboard .stat-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--tu-gray);
    border-radius: 4px;
}

.stat-label,
.hpc-dashboard .stat-label {
    font-size: 0.9rem;
    color: #666;
}

.stat-value,
.hpc-dashboard .stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--tu-dark-blue);
}

/* Resource Stats Styling */
.resource-stats,
.hpc-dashboard .resource-stats {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem;
}

.resource-label,
.hpc-dashboard .resource-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.resource-value,
.hpc-dashboard .resource-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--tu-dark-blue);
    line-height: 1.2;
}

.resource-detail,
.hpc-dashboard .resource-detail {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.2rem;
}


/* Partition Status Cards */
.partitions-grid,
.hpc-dashboard .partitions-grid {
    margin-top: 2rem;
}

#partition-cards,
.hpc-dashboard #partition-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.partition-card,
.hpc-dashboard .partition-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.partition-header,
.hpc-dashboard .partition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.partition-header h3,
.hpc-dashboard .partition-header h3 {
    margin: 0;
    color: var(--tu-dark-blue);
}

/* Node Status Display */
.node-grid,
.hpc-dashboard .node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.node-item,
.hpc-dashboard .node-item {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #f8f9fa;
}

.node-header,
.hpc-dashboard .node-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.node-status,
.hpc-dashboard .node-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-left: auto;
    background: #e9ecef;
}

.status-indicator,
.hpc-dashboard .status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Node Status Colors */
.status-IDLE,
.hpc-dashboard .status-IDLE { background: #22c55e; }

.status-MIXED,
.hpc-dashboard .status-MIXED { background: #f59e0b; }

.status-DOWN,
.hpc-dashboard .status-DOWN { background: #ef4444; }

.status-ALLOCATED,
.hpc-dashboard .status-ALLOCATED { background: #3b82f6; }

.status-COMPLETING,
.hpc-dashboard .status-COMPLETING { background: #8b5cf6; }

.status-DRAINING,
.hpc-dashboard .status-DRAINING { background: #f97316; }

.status-DOWN\+NOT_RESPONDING,
.hpc-dashboard .status-DOWN\+NOT_RESPONDING { background: #dc2626; }

.node-stats,
.hpc-dashboard .node-stats {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.node-stats small,
.hpc-dashboard .node-stats small {
    color: #666;
}

/* GPU Details */
.gpu-stats,
.hpc-dashboard .gpu-stats {
    margin-top: 0.8rem;
    padding: 0.5rem;
    background: rgba(0,169,183,0.05);
    border-radius: 4px;
}

.gpu-summary,
.hpc-dashboard .gpu-summary {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(0,169,183,0.2);
    margin-bottom: 0.5rem;
}

.gpu-detail,
.hpc-dashboard .gpu-detail {
    margin-top: 0.5rem;
    padding: 0.3rem;
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
}

.gpu-model,
.hpc-dashboard .gpu-model {
    font-weight: 600;
    color: var(--tu-dark-blue);
}

.gpu-stats-detail,
.hpc-dashboard .gpu-stats-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
    margin-top: 0.3rem;
    padding-left: 0.5rem;
}

.warning,
.hpc-dashboard .warning {
    color: #ef4444;
    margin-top: 0.2rem;
    font-weight: 500;
}

.high-usage,
.hpc-dashboard .high-usage {
    border-left: 3px solid #ef4444;
    padding-left: 0.5rem;
}

/* Usage Meters */
.usage-meter,
.hpc-dashboard .usage-meter {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.usage-fill,
.hpc-dashboard .usage-fill {
    height: 100%;
    background: var(--tu-teal);
    transition: width 0.3s ease;
}

/* Memory Display */
.memory-info,
.hpc-dashboard .memory-info {
    margin-top: 0.3rem;
}

/* GPU No Access Display - Enhanced */
.gpu-no-access,
.hpc-dashboard .gpu-no-access {
    background-color: #FFEB3B;
    border-radius: 4px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
    border: 1px solid #FFC107;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.no-access-text,
.hpc-dashboard .no-access-text {
    color: #000;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.no-access-reason,
.hpc-dashboard .no-access-reason {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* Debug section - hidden by default */
.debug-section,
.hpc-dashboard .debug-section {
    display: none;  /* Change to 'block' for development if needed */
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 2rem;
    overflow: auto;
}

.debug-output,
.hpc-dashboard .debug-output {
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Node History Grid Layout */
.partition-grid,
.hpc-dashboard .partition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.partition-history-block,
.hpc-dashboard .partition-history-block {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.node-history-row,
.hpc-dashboard .node-history-row {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
    min-height: 1.5rem;
    justify-content: flex-start;
}

.node-name-header,
.hpc-dashboard .node-name-header {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    height: 80px;
    width: 24px;
    font-size: 0.75rem;
    color: var(--tu-dark-blue);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 0.125rem;
}

.node-status-cell,
.hpc-dashboard .node-status-cell {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.node-status-cell:hover,
.hpc-dashboard .node-status-cell:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-grid,
.hpc-dashboard .status-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Legend Container */
.legend-container,
.hpc-dashboard .legend-container {
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.legend-section,
.hpc-dashboard .legend-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-title,
.hpc-dashboard .legend-title {
    font-weight: 500;
    color: var(--tu-dark-blue);
}

.legend-text,
.hpc-dashboard .legend-text {
    color: #666;
}

.legend-items,
.hpc-dashboard .legend-items {
    display: flex;
    gap: 1.5rem;
}

.legend-item,
.hpc-dashboard .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color,
.hpc-dashboard .legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
}

/* Background colors for status cells */
.bg-green-500,
.hpc-dashboard .bg-green-500 { background-color: #22c55e; }

.bg-yellow-500,
.hpc-dashboard .bg-yellow-500 { background-color: #eab308; }

.bg-red-500,
.hpc-dashboard .bg-red-500 { background-color: #ef4444; }

.bg-gray-200,
.hpc-dashboard .bg-gray-200 { background-color: #e5e7eb; }

/* GPU Status Indicator */
.gpu-indicator,
.hpc-dashboard .gpu-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.5rem;
    border-radius: 50%;
}

.normal-usage,
.hpc-dashboard .normal-usage {
    color: #22c55e;
    border-color: #22c55e;
}

.moderate-usage,
.hpc-dashboard .moderate-usage {
    color: #f59e0b;
    border-color: #f59e0b;
}

.high-usage,
.hpc-dashboard .high-usage {
    color: #f97316;
    border-color: #f97316;
}

.critical-usage,
.hpc-dashboard .critical-usage {
    color: #ef4444;
    border-color: #ef4444;
}

.gpu-header,
.hpc-dashboard .gpu-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
}

.gpu-warnings,
.hpc-dashboard .gpu-warnings {
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.critical-memory,
.hpc-dashboard .critical-memory {
    color: #ef4444;
}

.high-memory,
.hpc-dashboard .high-memory {
    color: #f97316;
}

.critical-temp,
.hpc-dashboard .critical-temp {
    color: #ef4444;
}

.high-temp,
.hpc-dashboard .high-temp {
    color: #f97316;
}

.critical-power,
.hpc-dashboard .critical-power {
    color: #ef4444;
}

.high-power,
.hpc-dashboard .high-power {
    color: #f97316;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .overview-cards,
    .hpc-dashboard .overview-cards {
        grid-template-columns: 1fr;
        height: auto;
    }

    #usage-chart,
    .hpc-dashboard #usage-chart {
        height: 300px;
    }

    #partition-cards,
    .hpc-dashboard #partition-cards {
        grid-template-columns: 1fr;
    }

    .partition-grid,
    .hpc-dashboard .partition-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-grid,
    .hpc-dashboard .stats-grid {
        grid-template-columns: 1fr;
    }

    .node-grid,
    .hpc-dashboard .node-grid {
        grid-template-columns: 1fr;
    }

    .legend-container,
    .hpc-dashboard .legend-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .partition-grid,
    .hpc-dashboard .partition-grid {
        grid-template-columns: 1fr;
    }

    .node-history-row,
    .hpc-dashboard .node-history-row {
        overflow-x: auto;
    }
}

/* NEW STUFF FOR NON-DASHBOARD CONTENT */

/* Internal navigation menu */
.internal-nav {
    background-color: #004C6C;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
}

.nav-item {
    color: white;
    padding: 1rem 1.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.nav-item:hover, 
.nav-item.active {
    background-color: #00a9b7;
    text-decoration: none;
}

/* Service highlights section */
.service-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.highlight-item {
    background-color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #00a9b7;
}

/* Resource tables */
.resource-table {
    overflow-x: auto;
    margin: 1rem 0 2rem 0;
}

.resource-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.resource-table th {
    background-color: #004C6C;
    color: white;
    text-align: left;
    padding: 0.8rem;
}

.resource-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
}

.resource-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Code styles */
code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: monospace;
    line-height: 1.5;
    margin: 1rem 0;
}

/* Guide section styling */
.guide-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.guide-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-color: #00a9b7;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 0.5rem;
    font-weight: bold;
}

.command-example {
    background-color: #004C6C;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    position: relative;
}

.command-example::before {
    content: "$";
    position: absolute;
    left: 0.5rem;
    color: #00a9b7;
}

.code-output {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    border-left: 4px solid #004C6C;
}

/* Notes and warnings */
.note-box, 
.warning-box {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    position: relative;
    padding-left: 3rem;
}

.note-box {
    background-color: #e6f7f8;
    border-left: 4px solid #00a9b7;
}

.warning-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.note-box::before,
.warning-box::before {
    position: absolute;
    left: 1rem;
    font-weight: bold;
}

.note-box::before {
    content: "ℹ️";
}

.warning-box::before {
    content: "⚠️";
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .internal-nav {
        flex-direction: column;
    }
    
    .service-highlights {
        grid-template-columns: 1fr;
    }
    
    .resource-table {
        font-size: 0.8rem;
    }
}


/* Access Denied Styling - add to existing dashboard.css */

/* Initially hide content until access check completes */
.content-hidden {
    display: none;
}

/* Access denied page specific styles */
.access-denied-page {
    background-color: var(--tu-gray, #f5f5f5);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.access-container {
    max-width: 600px;
    width: 100%;
    padding: 2rem;
}

.access-message {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.access-logo {
    max-width: 200px;
    margin-bottom: 2rem;
}

.access-message h1 {
    color: var(--tu-dark-blue, #004C6C);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.access-message p {
    margin-bottom: 1rem;
    color: #555;
}

.access-actions {
    margin-top: 2rem;
}

.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
