/* style.css - Clean glassmorphism styling for VPS reports dashboard */

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(139, 92, 246, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

/* Buttons & Inputs */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status Badges */
.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-badge.ok, .status-badge-lg.ok {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.warning, .status-badge-lg.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.error, .status-badge-lg.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 1. Login View Layout */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

#login-btn {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
}

/* 2. Dashboard Shell Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Navigation Sidebar */
.sidebar {
    height: 100vh;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.3px;
}

.vps-ip {
    font-family: monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.reports-history-section {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.reports-history-section h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 16px;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-item {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.report-item.active {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
}

.report-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-date {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-summary-brief {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    padding: 30px;
    overflow-y: auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.report-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.status-badge-lg {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Placeholders */
.placeholder-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    text-align: center;
    gap: 12px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 8px;
    animation: pulse 3s infinite;
}

.placeholder-section h2 {
    font-size: 20px;
    color: var(--text-primary);
}

.placeholder-section p {
    color: var(--text-secondary);
    max-width: 450px;
    font-size: 14px;
}

/* Details Section Layout */
.details-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

/* Metrics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.metric-card {
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.metric-card:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.05);
}

.metric-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.04);
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Standard Content Card */
.content-card {
    padding: 24px;
    border-radius: 12px;
}

.content-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-text {
    font-size: 14.5px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Container status horizontal layout */
.containers-list-horizontal {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.container-item-horizontal {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13.5px;
}

.container-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.container-status-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    margin-left: 8px;
}

/* Issues List (Full width) */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.issue-item {
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 4px solid transparent;
    background: rgba(255, 255, 255, 0.01);
}

.issue-item.severity-high {
    border-left-color: var(--color-danger);
    background: rgba(239, 68, 68, 0.03);
}

.issue-item.severity-medium {
    border-left-color: var(--color-warning);
    background: rgba(245, 158, 11, 0.03);
}

.issue-item.severity-low {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.03);
}

.issue-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.issue-time {
    color: var(--color-warning);
    font-family: monospace;
    font-size: 12.5px;
    margin-right: 4px;
}

.issue-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Highlight AI prompt card */
.highlight-card {
    border-color: rgba(139, 92, 246, 0.2);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.5), rgba(139, 92, 246, 0.03));
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.prompt-box {
    background: rgba(5, 8, 16, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

.prompt-box pre {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    color: #c084fc;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Collapsible Logs Card */
.collapsible-card {
    padding: 0 !important;
    overflow: hidden;
}

.collapsible-trigger {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    width: 100%;
    padding: 18px 24px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.collapsible-trigger:hover {
    background: rgba(255, 255, 255, 0.02);
}

.collapsible-trigger .arrow {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.collapsible-trigger.active .arrow {
    transform: rotate(180deg);
}

.collapsible-content {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
}

.logs-box {
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.logs-box pre {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 11px;
    color: #cbd5e1;
    white-space: pre;
}

/* Toast System */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
    border: 1px solid transparent;
}

.toast.success {
    background: #064e3b;
    color: #34d399;
    border-color: #059669;
}

.toast.error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #dc2626;
}

/* Skeletons */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-item {
    height: 58px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-item::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    animation: loading 1.5s infinite;
}

/* Keyframes Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes loading {
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.03); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Responsive adjustment for Sidebar */
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        height: auto;
        position: relative;
        border-radius: 0;
    }
    .main-content {
        height: auto;
    }
}
