/* QuestMonitor Dashboard Styles */

:root {
    --color-bg: #1a1a2e;
    --color-bg-secondary: #16213e;
    --color-card: #0f3460;
    --color-primary: #4a90d9;
    --color-text: #ffffff;
    --color-text-secondary: #a0a0a0;
    --color-healthy: #4caf50;
    --color-warning: #ff9800;
    --color-critical: #f44336;
    --color-offline: #9e9e9e;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: var(--color-bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-update {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #5a9fe9;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Tabs */
.tabs {
    background-color: var(--color-bg-secondary);
    padding: 0 2rem;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tab-indicator.healthy { background-color: var(--color-healthy); }
.tab-indicator.warning { background-color: var(--color-warning); }
.tab-indicator.critical { background-color: var(--color-critical); }
.tab-indicator.offline { background-color: var(--color-offline); }

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Loading & Error States */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--color-text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.error-message {
    color: var(--color-critical);
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* Status Overview */
.status-overview {
    margin-bottom: 2rem;
}

.main-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-offline);
    flex-shrink: 0;
}

.status-indicator.healthy { background-color: var(--color-healthy); }
.status-indicator.warning { background-color: var(--color-warning); }
.status-indicator.critical { background-color: var(--color-critical); }
.status-indicator.offline { background-color: var(--color-offline); }

.status-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.status-text {
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.status-text.healthy { color: var(--color-healthy); }
.status-text.warning { color: var(--color-warning); }
.status-text.critical { color: var(--color-critical); }
.status-text.offline { color: var(--color-offline); }

.last-seen {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-card {
    background-color: var(--color-card);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
}

.status-card h3 {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.status-row:last-child {
    margin-bottom: 0;
}

.status-row .label {
    color: var(--color-text-secondary);
}

.status-row .value {
    font-weight: 500;
}

/* Data Panels */
.data-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .data-panels {
        grid-template-columns: 1fr;
    }
}

.panel {
    background-color: var(--color-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-header select {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.screenshot-thumb {
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.screenshot-thumb:hover {
    transform: scale(1.05);
}

.screenshot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Log List */
.log-list {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
}

.log-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.75rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.log-level {
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

.log-level.info { background-color: rgba(74, 144, 217, 0.3); color: var(--color-primary); }
.log-level.warning { background-color: rgba(255, 152, 0, 0.3); color: var(--color-warning); }
.log-level.error { background-color: rgba(244, 67, 54, 0.3); color: var(--color-critical); }
.log-level.critical { background-color: var(--color-critical); color: white; }

.log-message {
    flex: 1;
    word-break: break-word;
}

/* Crash Reports */
.crash-reports .panel {
    margin-bottom: 2rem;
}

.crash-list {
    padding: 1rem;
}

.crash-entry {
    padding: 1rem;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--color-critical);
}

.crash-entry:last-child {
    margin-bottom: 0;
}

.crash-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.crash-type {
    font-weight: 600;
    color: var(--color-critical);
}

.crash-time {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.crash-details {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* Empty State */
.empty-state {
    color: var(--color-text-secondary);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .main-status {
        flex-direction: column;
        text-align: center;
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .screenshot-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
