:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --error-color: #ef4444;
    --success-color: #10b981;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

* {
    box-sizing: border-box;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
    flex: 1;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* Typography */
h1 {
    font-weight: 700;
    letter-spacing: -0.025em;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2rem;
    }
}

h2 {
    font-weight: 600;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: #8b5cf6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

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

/* Forms */
input[type="text"],
input[type="password"],
textarea,
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Dashboard Specifics */
.header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .brand {
        font-size: 1.5rem;
    }
    .header {
        margin-bottom: 3rem;
    }
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    .header-controls {
        flex-direction: row;
        align-items: center;
        width: auto;
        gap: 1rem;
    }
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .nav-links {
        margin-bottom: 0;
        margin-right: 1rem;
        gap: 1rem;
    }
}


.purge-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .purge-layout {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

.terminal {
    background: #000;
    color: #0f0;
    font-family: 'Fira Code', monospace;
    padding: 1rem;
    border-radius: 0.5rem;
    height: 300px;
    overflow-y: auto;
    font-size: 0.8125rem;
    border: 1px solid #333;
}

@media (min-width: 768px) {
    .terminal {
        height: 400px;
        font-size: 0.875rem;
    }
}

.log-line {
    margin: 0.25rem 0;
    word-break: break-all;
}

.log-success {
    color: #10b981;
}

.log-error {
    color: #ef4444;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
}

.stat-card {
    padding: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .stat-card {
        padding: 1.5rem;
    }
}

.stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

@media (min-width: 768px) {
    .stat-val {
        font-size: 2rem;
    }
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .stat-label {
        font-size: 0.875rem;
    }
}

/* Login Page */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .login-card {
        padding: 2.5rem;
    }
}

.flash {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Status Bar */
.progress-bar {
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-value {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--card-border);
}

.floating-nav .container {
    padding: 0.75rem 1rem;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .floating-nav .container {
        padding: 0.75rem 2rem;
    }
}

.floating-nav .header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    flex-wrap: wrap; 
    justify-content: space-between;
}

@media (max-width: 600px) {
    .floating-nav .header {
        align-items: stretch;
    }
}

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

@media (max-width: 600px) {
    .user-text {
        display: none;
    }
}

/* Adjust page content to prevent overlap */
.container.main-content {
    margin-top: 7rem;
}

@media (min-width: 600px) {
    .container.main-content {
        margin-top: 5rem;
    }
}

/* Tables and Forms utilities */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.form-inline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-inline {
        flex-direction: row;
        align-items: center;
    }
}

.panel-content {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .panel-content {
        padding: 2rem;
    }
}

/* Support Page Layout */
.support-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 900px) {
    .support-layout {
        grid-template-columns: 250px 1fr;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 0;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    transition: 0.2s;
    font-size: 1rem;
}

.tab-btn.active {
    color: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
