/**
 * Customer Page CSS - ChatGPT Style Dark Theme
 * Clean and modern design inspired by ChatGPT
 */

/* CSS Variables - ChatGPT Color Palette */
:root {
    --bg-main: #343541;
    --bg-secondary: #444654;
    --bg-card: #40414f;
    --bg-hover: #4a4b5a;
    --bg-sidebar: #202123;
    --border-color: #4d4d4f;
    --text-primary: #ececf1;
    --text-secondary: #c5c5d2;
    --text-muted: #8e8ea0;
    --accent-color: #10a37f;
    --accent-hover: #0d8a6b;
    --success-color: #10a37f;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden {
    display: none !important;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Language Switch */
.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.lang-switch:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.last-update {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.update-label {
    color: var(--text-muted);
}

#last-updated {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Model List */
.model-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* Model Card */
.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.model-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* Model Header */
.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 200px;
}

.model-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    flex-shrink: 0;
    background: var(--bg-secondary);
    padding: 6px;
}

.model-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.model-id {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Status Badge */
.model-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

.model-status.online {
    background: rgba(16, 163, 127, 0.15);
    color: var(--success-color);
}

.model-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.model-status.unknown {
    background: rgba(142, 142, 160, 0.15);
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Progress Section */
.progress-section {
    margin-bottom: 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.progress-bar {
    display: flex;
    gap: 3px;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    padding: 4px;
}

.progress-slot {
    flex: 1;
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.progress-slot::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-sidebar);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 10;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.progress-slot:hover::after {
    opacity: 1;
    visibility: visible;
}

.progress-slot.success {
    background: var(--success-color);
}

.progress-slot.failure {
    background: var(--danger-color);
}

.progress-slot.unknown {
    background: var(--border-color);
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-value.good {
    color: var(--success-color);
}

.stat-value.warning {
    color: var(--warning-color);
}

.stat-value.bad {
    color: var(--danger-color);
}

.stat-value.neutral {
    color: var(--text-muted);
}

/* Error Info */
.error-info {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 4px;
}

.error-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger-color);
    margin-bottom: 6px;
}

.error-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-code {
    display: inline-block;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 32px;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .model-card {
        padding: 18px;
    }

    .lang-switch {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .model-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .model-logo {
        width: 36px;
        height: 36px;
    }

    .stat-item {
        padding: 10px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .progress-bar {
        height: 20px;
    }
}