/* =========================================================
   PALWORLD WEB CONTROLLER - DARK GLASSMORPHISM STYLESHEET
   ========================================================= */

:root {
    --bg-dark: #0b0e14;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --accent-blue: #00F2FE;
    --accent-cyan: #4FACFE;
    --accent-green: #00FF7F;
    --accent-purple: #7F00FF;
    --accent-red: #FF416C;
    --accent-orange: #FF4B2B;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(127, 0, 255, 0.08) 0%, transparent 40%);
}

/* --- LOGIN PAGE STYLES --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #151d2a 0%, #080b10 100%);
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-glow);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.brand-header {
    margin-bottom: 25px;
}

.brand-icon {
    font-size: 40px;
    color: var(--accent-blue);
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

.brand-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    font-size: 13px;
}

.error-alert {
    background: rgba(255, 65, 108, 0.15);
    border: 1px solid rgba(255, 65, 108, 0.4);
    color: #ff859c;
}

.alert-icon {
    font-size: 20px;
    margin-top: 2px;
}

.login-instruction {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.steam-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #171a21 0%, #2a475e 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.steam-login-btn i {
    font-size: 24px;
}

.steam-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.3);
    border-color: var(--accent-blue);
}

.login-footer {
    margin-top: 25px;
    font-size: 12px;
    color: var(--text-muted);
}

/* --- DASHBOARD STYLES --- */
.dashboard-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 26px;
    color: var(--accent-blue);
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-badge.online {
    background: rgba(0, 255, 127, 0.15);
    border: 1px solid rgba(0, 255, 127, 0.4);
    color: var(--accent-green);
}

.status-badge.offline {
    background: rgba(255, 65, 108, 0.15);
    border: 1px solid rgba(255, 65, 108, 0.4);
    color: var(--accent-red);
}

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

.online .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s infinite;
}

.offline .status-dot {
    background: var(--accent-red);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.user-icon {
    font-size: 18px;
    color: var(--accent-cyan);
}

.user-label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.logout-btn {
    color: var(--text-muted);
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--accent-red);
    background: rgba(255, 65, 108, 0.1);
}

/* MAIN CONTAINER */
.main-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(10px);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
}

.metric-icon.blue { background: rgba(0, 242, 254, 0.15); color: var(--accent-blue); }
.metric-icon.green { background: rgba(0, 255, 127, 0.15); color: var(--accent-green); }
.metric-icon.purple { background: rgba(127, 0, 255, 0.15); color: #b866ff; }

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

.metric-title {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    margin: 2px 0;
}

.metric-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* SECTION CONTAINERS */
.section-container {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;

}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;

}

.count-badge {
    background: rgba(0, 242, 254, 0.15);
    color: var(--accent-blue);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* BUTTONS */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-warning { background: linear-gradient(135deg, #FF4B2B 0%, #FF416C 100%); color: #fff; }
.btn-info { background: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%); color: #0b0e14; }
.btn-success { background: linear-gradient(135deg, #00FF7F 0%, #00b05b 100%); color: #0b0e14; }
.btn-purple { background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%); color: #fff; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid var(--border-color); }
.btn-danger { background: #FF416C; color: #fff; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: 0.2s;
}

.btn-sm:hover { background: rgba(255, 255, 255, 0.2); }
.btn-kick { background: rgba(255, 165, 0, 0.2); color: orange; border: 1px solid orange; }
.btn-kick:hover { background: orange; color: #000; }
.btn-ban { background: rgba(255, 65, 108, 0.2); color: #ff5277; border: 1px solid #ff5277; }
.btn-ban:hover { background: #ff5277; color: #fff; }

/* DASHBOARD GRID & TABLE */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.custom-table th {
    padding: 12px 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.custom-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.empty-table {
    text-align: center;
    color: var(--text-muted);
    padding: 30px !important;
}

/* EVENT LOG FEED */
.activity-log-feed {
    height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.log-item {
    font-size: 12px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-item.join { border-left-color: var(--accent-green); }
.log-item.leave { border-left-color: var(--accent-red); }
.log-item.system { border-left-color: var(--accent-blue); }

.log-time {
    font-size: 10px;
    color: var(--text-muted);
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-dark);
    border: 1px solid var(--bg-card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-glow);
    padding: 24px;
    animation: zoomIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-main);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* TOASTS */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.danger { border-left: 4px solid var(--accent-red); }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
