/* Base Styles & Variables */
:root {
    --bg-dark: #050505;
    --text-main: #f0f0f5;
    --text-muted: #a0a0b0;
    --primary: #FFD700;
    --primary-hover: #FFC107;
    --accent: #FFA500;
    --danger: #ef4444;
    --success: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 215, 0, 0.15);
    --glass-glow: 0 8px 32px 0 rgba(255, 215, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    cursor: crosshair;
}

/* Background Effects */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-dark);
}

/* Glassmorphism Utilities */
.glass-card, .glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-glow);
    border-radius: 20px;
}

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

.glass-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
}



@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px) rotateX(-10deg); }
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.logo-area {
    text-align: center;
    margin-bottom: 40px;
}

.main-logo {
    width: 280px;
    height: auto;
    margin: 0 auto 16px;
    display: block;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.3));
    animation: floatLogo 6s infinite ease-in-out;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-area h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.logo-area p {
    color: var(--text-muted);
    font-size: 14px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), inset 0 0 10px rgba(255, 215, 0, 0.1);
    background: rgba(0, 0, 0, 0.6);
    transform: translateZ(10px);
}



.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 10px;
    color: #111;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateZ(20px);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.primary-btn:hover::before {
    left: 150%;
}

.primary-btn:hover {
    transform: translateY(-3px) translateZ(20px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 165, 0, 0.4);
    color: #000;
}

.primary-btn:active {
    transform: translateY(1px) translateZ(20px) scale(0.98);
}

/* --- Dashboard Layout --- */
.dashboard-layout {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon.small {
    width: 32px;
    height: 32px;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: white;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

/* Custom Scrollbar for main content */
.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

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

.header-search input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    width: 250px;
    transition: all 0.3s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    width: 300px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-indicator.online { background: var(--success); box-shadow: 0 0 8px var(--success); }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto 1fr;
    gap: 16px;
    flex: 1;
}

/* Stats Cards */
.stat-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card h3 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 500;
}
.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }
.stat-trend.neutral { color: var(--text-muted); }

/* Chart Section */
.chart-section {
    grid-column: span 3;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

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

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.time-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover { background: rgba(255, 255, 255, 0.05); }
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chart-placeholder {
    flex: 1;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.pulse-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 3s infinite linear;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Activity Section */
.activity-section {
    grid-column: span 1;
    padding: 24px;
}

.activity-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 16px;
    border-left: 2px solid var(--glass-border);
    position: relative;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.activity-item.error::before { background: var(--danger); border-left-color: rgba(239, 68, 68, 0.3); }
.activity-item.error { border-left-color: rgba(239, 68, 68, 0.3); }

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

.activity-desc {
    font-size: 13px;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-section { grid-column: span 2; }
    .activity-section { grid-column: span 2; }
}

/* --- Dashboard Tabs & Components --- */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Hits Table */
.hits-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.hits-table th {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

.hits-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.05);
    font-size: 14px;
}

.hits-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Checkboxes */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: default;
    font-size: 14px;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: default;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- View Logs Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    padding: 24px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

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

.close-modal:hover {
    color: var(--danger);
}

.terminal-box {
    background: #000;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-box code {
    color: var(--success);
    font-size: 13px;
    line-height: 1.5;
}

.tab-pane {
    display: none;
}

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