/*
 * Double Tap Server Manager - Global Styles
 * Red/Dark Gaming Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Teko:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f1018;
    --bg-tertiary: #181a24;
    --bg-hover: #22243a;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent: #dc2626;
    --accent-light: #ef4444;
    --accent-hover: #b91c1c;
    --accent-glow: rgba(220, 38, 38, 0.15);

    --border-color: rgba(220, 38, 38, 0.1);
    --border-hover: rgba(220, 38, 38, 0.25);

    --online: #10b981;
    --offline: #ef4444;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --purple: #8b5cf6;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.5);

    --font-display: 'Bebas Neue', 'Impact', 'Arial Black', sans-serif;
    --font-body: 'Teko', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

input[type="hidden"] {
    display: none !important;
}

body {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 15% 0%, rgba(200, 20, 20, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(200, 20, 20, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(150, 10, 10, 0.06) 0%, transparent 60%),
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0.03) 75%, transparent 75%, transparent),
        linear-gradient(-45deg, rgba(255,255,255,0.015) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.015) 50%, rgba(255,255,255,0.015) 75%, transparent 75%, transparent);
    background-size: auto, auto, auto, 20px 20px, 20px 20px;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--accent-light);
    font-weight: 700;
    letter-spacing: 0.04em;
}

h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(220,38,38,0.5), 0 0 80px rgba(220,38,38,0.2), 0 2px 4px rgba(0,0,0,0.5);
}

h2 {
    font-size: 1.5rem;
    text-transform: uppercase;
}

/* ── Navigation ── */
.navbar {
    background: rgba(8, 8, 12, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(220,38,38,0.15);
    padding: 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5), 0 0 40px rgba(220,38,38,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 2rem;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
    text-decoration: none;
    text-shadow: 0 0 20px var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: #f87171;
    text-shadow: 0 0 30px rgba(220,38,38,0.4);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.navbar-menu a {
    font-family: var(--font-display);
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.navbar-menu a:hover {
    background: rgba(220,38,38,0.1);
    color: var(--text-primary);
}

.navbar-menu a.active {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(220,38,38,0.35);
}

/* ── Container ── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ── Flash Messages ── */
.flash-messages {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 2rem;
}

.alert {
    font-family: var(--font-body);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    font-weight: 600;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid var(--success); color: var(--success); }
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid var(--danger);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid var(--warning); color: var(--warning); }
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid var(--info);    color: var(--info); }

/* ── Cards ── */
.card {
    background: linear-gradient(135deg, rgba(18,18,28,0.9) 0%, rgba(10,10,18,0.95) 100%);
    border: 1px solid rgba(220,38,38,0.12);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-light);
    text-transform: uppercase;
}

.card-body {
    color: var(--text-primary);
}

/* ── Server Grid ── */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

/* ── Server Card ── */
.server-card {
    background: linear-gradient(135deg, rgba(18,18,28,0.9) 0%, rgba(10,10,18,0.95) 100%);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 14px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 0 30px rgba(220,38,38,0.02);
    position: relative;
    overflow: hidden;
}

/* Strong red left accent glow */
.server-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ff3333 0%, #dc2626 30%, #991b1b 70%, transparent 100%);
    box-shadow: 0 0 12px rgba(220,38,38,0.4), 0 0 24px rgba(220,38,38,0.15);
}

/* Top red line */
.server-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,50,50,0.6), rgba(220,38,38,0.2) 60%, transparent);
}

.server-card:hover {
    border-color: rgba(220,38,38,0.35);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 40px rgba(220,38,38,0.1), inset 0 0 40px rgba(220,38,38,0.03);
    transform: translateY(-4px);
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.server-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-shadow: 0 0 25px rgba(220,38,38,0.4), 0 2px 4px rgba(0,0,0,0.3);
}

/* ── Status Badges ── */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.875rem;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    white-space: nowrap;
}

.server-status.status-running {
    background: rgba(16,185,129,0.1);
    color: #10b981;
    border: 2px solid rgba(16,185,129,0.5);
    box-shadow: 0 0 15px rgba(16,185,129,0.2), 0 0 30px rgba(16,185,129,0.08);
}

.server-status.status-stopped {
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    border: 2px solid rgba(239,68,68,0.35);
    box-shadow: 0 0 15px rgba(239,68,68,0.1);
}

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

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16,185,129,0.6);
    animation: pulse-glow 2s ease-in-out infinite;
}

.status-indicator.offline {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.4);
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16,185,129,0.6); }
    50% { opacity: 0.5; box-shadow: 0 0 4px rgba(16,185,129,0.3); }
}

/* ── Buttons ── */
.btn {
    font-family: var(--font-display);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: 1px solid rgba(239,68,68,0.4);
    box-shadow: 0 4px 16px rgba(220,38,38,0.3);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 24px rgba(220,38,38,0.5);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    text-decoration: none;
    color: white;
}

.btn-success {
    background: rgba(16,185,129,0.15);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.35);
}
.btn-success:hover:not(:disabled) {
    background: rgba(16,185,129,0.25);
    border-color: rgba(16,185,129,0.6);
    color: #6ee7b7;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16,185,129,0.2);
}

.btn-warning {
    background: rgba(251,146,60,0.15);
    color: #fb923c;
    border: 1px solid rgba(251,146,60,0.35);
}
.btn-warning:hover:not(:disabled) {
    background: rgba(251,146,60,0.25);
    border-color: rgba(251,146,60,0.6);
    color: #fdba74;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(251,146,60,0.2);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.35);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.6);
    color: #fca5a5;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239,68,68,0.2);
}

.btn-secondary {
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.btn-console {
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}
.btn-console:hover:not(:disabled) {
    background: rgba(59,130,246,0.22);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.2);
    text-decoration: none;
}

.btn-logs {
    background: rgba(6,182,212,0.12);
    color: #22d3ee;
    border: 1px solid rgba(6,182,212,0.3);
}
.btn-logs:hover:not(:disabled) {
    background: rgba(6,182,212,0.22);
    color: #67e8f9;
    border-color: rgba(6,182,212,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6,182,212,0.2);
    text-decoration: none;
}

.btn-update {
    background: rgba(139,92,246,0.12);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.3);
}
.btn-update:hover:not(:disabled) {
    background: rgba(139,92,246,0.22);
    color: #c4b5fd;
    border-color: rgba(139,92,246,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139,92,246,0.2);
    text-decoration: none;
}

.btn-verify {
    background: rgba(20,184,166,0.12);
    color: #2dd4bf;
    border: 1px solid rgba(20,184,166,0.3);
}
.btn-verify:hover:not(:disabled) {
    background: rgba(20,184,166,0.22);
    color: #5eead4;
    border-color: rgba(20,184,166,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20,184,166,0.2);
    text-decoration: none;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    color: var(--text-primary);
    cursor: pointer;
}

/* ── Tables ── */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    font-family: var(--font-display);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--accent-light);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ── Console ── */
.console {
    background: #050508;
    color: #10b981;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    height: 600px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.4;
}

.console-line {
    margin-bottom: 0.25rem;
}

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

.login-card {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, rgba(18,18,28,0.95) 0%, rgba(10,10,18,0.98) 100%);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 14px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(220,38,38,0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

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

/* ── Badges ── */
.badge {
    font-family: var(--font-display);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success { background: rgba(16,185,129,0.15); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-info    { background: rgba(59,130,246,0.15);  color: var(--info);    border: 1px solid rgba(59,130,246,0.3); }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-secondary { color: var(--text-secondary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ── Loading Spinner ── */
.spinner {
    border: 3px solid rgba(220,38,38,0.2);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ── Footer ── */
.footer {
    margin-top: auto;
    padding: 1rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer .text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

    .server-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 1rem;
    }

    .table-container {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}
