/* Style Sheet for Bilingual PHP 8.2 Log Server Portal */
/* Theme: Cyber Security Dark Mode */

:root {
    --bg-main: #090d16;
    --bg-card: #111726;
    --bg-card-hover: #161e30;
    --bg-sidebar: #0b0f1a;
    --border-color: rgba(255, 255, 255, 0.06);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.15);

    --accent-purple: #8b5cf6;
    
    --status-online: #10b981;
    --status-offline: #ef4444;
    --status-warning: #f59e0b;

    --font-outfit: 'Outfit', sans-serif;
    --font-thai: 'IBM Plex Sans Thai', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-thai);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Layout App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 24px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 28px;
    color: var(--accent-emerald);
    filter: drop-shadow(0 0 8px var(--accent-emerald-glow));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Sidebar User Info */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 24px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-blue-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 20px;
}

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

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 4px;
}

.badge-admin {
    background-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-auditor {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Language Switcher */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-switcher:hover {
    background: var(--accent-blue-glow);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.lang-label {
    letter-spacing: 0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-family: var(--font-thai);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}
.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--accent-emerald);
    color: white;
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

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

.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-logout {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-logout:hover {
    background: #ef4444;
    color: white;
}

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

.content-header {
    height: 80px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-sidebar);
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
}

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

.status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--status-online);
}

.content-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid transparent;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.06);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.15);
}
.alert-success {
    background: rgba(16, 185, 129, 0.06);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.15);
}
.alert-info {
    background: rgba(59, 130, 246, 0.06);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.15);
}
.alert-warning {
    background: rgba(245, 158, 11, 0.06);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.15);
}

/* Cards & Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.card-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-family: var(--font-outfit);
    font-size: 28px;
    font-weight: 700;
}

.card-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.03);
}

.card-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Interactive Charts / Statistics */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

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

.list-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.list-item-key {
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-val {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Log Filter Box */
.filter-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-thai);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

select.form-control {
    cursor: pointer;
}

.form-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

/* Log Table styling */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.log-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.log-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.log-timestamp {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    white-space: nowrap;
}

.log-host {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-weight: 500;
}

.log-tag {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-primary);
}

.log-message {
    font-family: var(--font-mono);
    color: #e2e8f0;
    word-break: break-all;
    max-width: 500px;
}

.log-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Log Severity Badges */
.severity-badge {
    font-family: var(--font-outfit);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
    width: 65px;
}

.severity-0, .severity-1, .severity-2, .severity-3 {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
} /* Emergency, Alert, Critical, Error */

.severity-4 {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
} /* Warning */

.severity-5, .severity-6 {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
} /* Notice, Info */

.severity-7 {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.2);
} /* Debug */

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.01);
    border-top: 1px solid var(--border-color);
}

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

.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* Verification and audit pages styling */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-verified {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-tampered {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: flash-red 1.5s infinite alternate;
}

@keyframes flash-red {
    from { box-shadow: 0 0 2px rgba(239, 68, 68, 0.1); }
    to { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
}

.status-missing {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Login Page Styling */
.login-body {
    background-color: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    font-family: var(--font-thai);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 100px;
    height: 100px;
    background: var(--accent-blue-glow);
    filter: blur(40px);
    border-radius: 50%;
}

.login-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: var(--accent-emerald-glow);
    filter: blur(40px);
    border-radius: 50%;
}

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

.login-brand-icon {
    font-size: 40px;
    color: var(--accent-emerald);
    filter: drop-shadow(0 0 10px var(--accent-emerald-glow));
    margin-bottom: 12px;
}

.login-title {
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.login-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Volume bar chart on dashboard */
.volume-chart-container {
    height: 180px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding-top: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    background: var(--accent-blue-glow);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.chart-bar:hover {
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
}

.chart-bar:hover::after {
    content: attr(data-count);
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 10;
}

.chart-bar-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: var(--font-mono);
}

.stats-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.stats-card-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-card-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}

/* Vertical Settings Sidebar Layout */
.settings-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 16px;
}

.settings-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-menu-title {
    font-family: var(--font-outfit);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 12px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: var(--font-thai);
}

.settings-menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.settings-menu-item.active {
    color: var(--accent-blue);
    background: var(--accent-blue-glow);
    border-color: rgba(59, 130, 246, 0.15);
    font-weight: 600;
}

.settings-menu-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Responsive adjustment for settings */
@media (max-width: 992px) {
    .settings-container {
        grid-template-columns: 1fr;
    }
}

