:root {
    --wg-primary: #2c3e50;
    --wg-primary-light: #3d5a73;
    --wg-primary-bright: #4a6885;
    --wg-primary-dark: #1e2b37;
    --wg-primary-bg: #f8f9fa;
    --wg-dark: #343a40;
    --wg-darker: #212529;
    --wg-medium: #495057;
    --wg-light: #f8f9fa;
}

body {
    background-color: #1a0d0d;
    color: #fff;
}

.card {
    background-color: white;
    border-color: rgba(0,0,0,.125);
    border-width: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #a71d2a;
    border-color: #7a1120;
    color: #fff;
}

.btn-primary, .btn-secondary {
    background-color: #a71d2a;
    border-color: #7a1120;
}

.btn-primary:hover, .btn-primary:focus, .btn-secondary:hover, .btn-secondary:focus {
    background-color: #7a1120;
    border-color: #a71d2a;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    color: #a71d2a;
    border-color: #a71d2a #a71d2a #fff;
    border-bottom: 2px solid #fff;
    font-weight: bold;
}

.nav-tabs .nav-link {
    color: #a71d2a;
    background: #fff0f0;
    border: 1px solid #a71d2a;
    border-bottom: none;
    margin-right: 2px;
    font-weight: 500;
}

.nav-tabs .nav-link:not(.active):hover {
    background: #f5d7db;
    color: #a71d2a;
}

.log-content {
    max-height: 600px;
    overflow-y: auto;
}

.table-fixed {
    table-layout: fixed;
}

.table-fixed th, .table-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.raw-log-content {
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 14px;
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    color: var(--wg-dark);
    border: 1px solid #dee2e6;
}

.container {
    background-color: #fff;
    color: #1a0d0d;
    border-radius: 10px;
    padding-top: 20px;
    padding-bottom: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--wg-primary);
}

.alert-info {
    background-color: #e9f5fc;
    border-color: #c5e5f5;
    color: #0a5b87;
}

.alert-warning {
    background-color: #fff8e1;
    border-color: #ffe0b2;
    color: #b68d00;
}

.table {
    color: #212529;
    border-color: #dee2e6;
}

.enhanced-log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

.enhanced-log-table th {
    background-color: var(--wg-primary);
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border: none;
    white-space: nowrap;
}

.enhanced-log-table td {
    padding: 12px 8px;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.enhanced-log-table tr:nth-child(even) td {
    background-color: white;
}

.enhanced-log-table tr:hover td {
    background-color: #e9ecef;
}

.log-detail {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-left: 5px;
}

.log-detail-icon {
    margin-right: 10px;
    color: var(--wg-primary);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.log-detail-text {
    flex-grow: 1;
}

.log-detail-label {
    font-weight: bold;
    margin-right: 5px;
    color: #6c757d;
}

.log-cell-container {
    display: flex;
    flex-direction: column;
}

.log-message {
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 8px;
    border-left: 3px solid var(--wg-primary);
}

.badge-ip {
    background-color: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.badge-port {
    background-color: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.badge-protocol {
    background-color: #6f42c1;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-action {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.badge-action-allow {
    background-color: #28a745;
    color: white;
}

.badge-action-deny {
    background-color: #dc3545;
    color: white;
}

.enhanced-log-entry {
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

.enhanced-log-entry:nth-child(odd) {
    background-color: #f8f9fa;
}

.enhanced-log-entry:nth-child(even) {
    background-color: white;
}

.log-entry-even {
    background-color: white !important;
}

.log-entry-odd {
    background-color: #f8f9fa !important;
}

.log-separator {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(44, 62, 80, 0.75), rgba(0, 0, 0, 0));
    margin: 1.5rem 0;
}

.log-entry-header {
    background-color: var(--wg-primary);
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid #dee2e6;
}

.log-entry-body {
    padding: 15px;
    background-color: inherit;
}

.log-time-badge {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 5px 10px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
}

.log-time-badge i {
    margin-right: 5px;
}

.log-time-badge.date-badge {
    background-color: rgba(255, 255, 255, 0.3);
}

.log-time-badge.time-badge {
    background-color: rgba(255, 255, 255, 0.25);
}

.log-time-badge.device-badge {
    background-color: rgba(255, 255, 255, 0.2);
}

.wg-header-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 6px 12px;
    margin-right: 15px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wg-header-badge:last-child {
    margin-right: 0;
}

.wg-header-badge i {
    margin-right: 8px;
    font-size: 1.1em;
}

.wg-header-badge.device-badge {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.15);
}

.wg-info-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
    border-left: 3px solid var(--wg-primary);
    padding-left: 10px;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.wg-info-item {
    display: flex;
    align-items: flex-start;
    margin: 8px 15px 8px 0;
    min-width: 200px;
}

.wg-info-item i {
    margin-right: 10px;
    font-size: 1.1em;
    color: var(--wg-primary);
    min-width: 20px;
    text-align: center;
}

.wg-info-label {
    font-weight: bold;
    margin-right: 8px;
    color: #6c757d;
}

.wg-info-value {
    word-break: break-word;
    color: #212529;
}

.wg-url-badge {
    background-color: #4e73df;
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-left: 5px;
    font-family: monospace;
    color: white;
}

.wg-section-title {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
    border-left: 3px solid var(--wg-primary);
    padding-left: 10px;
    color: var(--wg-primary);
}

.wg-section-title i {
    margin-right: 8px;
    color: var(--wg-primary);
}

/* Login Page Styles */
.login-container {
    max-width: 400px;
    width: 100%;
}

.logo-area {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-area img {
    max-width: 200px;
    margin-bottom: 1rem;
}

.logo-area h3 {
    color: var(--wg-primary);
    font-weight: 600;
}

.forgot-password {
    text-align: right;
    margin-bottom: 1rem;
}

/* Header Styles */
.dashboard-header {
    background: var(--wg-primary);
    color: #fff;
    padding: 2rem 1rem 1.5rem 1rem;
    border-radius: 0 0 16px 16px;
    min-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.breadcrumb-container {
    min-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
}

/* Form Styles */
.form-control, .input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}

.form-control:focus {
    background-color: white;
    border-color: var(--wg-primary);
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 80, 0.25);
    color: #212529;
}

/* Site Management Styles */
.site-alias-display {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.site-alias-form {
    display: inline-block;
    width: 100%;
}

.site-alias-form .input-group {
    max-width: 300px;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-info {
    background-color: var(--wg-primary) !important;
}

.badge.bg-secondary {
    background-color: var(--wg-medium) !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

/* Footer Styles */
footer {
    min-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Log Viewer Styles */
.site-selector-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s;
}

.site-selector-btn:hover {
    background-color: #e9ecef;
    color: #212529;
    text-decoration: none;
}

/* No Results Overlay Styles */
.no-results-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0.375rem;
}

.no-results-content {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

.no-results-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.no-results-content h5 {
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: 600;
}

.no-results-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Make chart containers relative for overlay positioning */
.card-body {
    position: relative;
}

/* Shorter height when showing no results overlay */
.card-body.no-results {
    min-height: 200px;
    height: 200px;
}

.card-body.no-results canvas {
    display: none;
}

/* Normal chart height - removed fixed min-height to allow cards to match content */
.card-body:not(.no-results) {
    /* min-height: 350px; - Removed to allow cards to match content height */
}

/* Remove all whitespace between search and calendar in logs.php */
.card.mb-4 {
    margin-bottom: 0 !important;
    min-height: unset !important;
    height: auto !important;
}
.card .card-body {
    padding-bottom: 0 !important;
    padding-top: 0.25rem !important;
}
/* Specific targeting for search form card - make it very compact */
.card.mb-4:first-of-type .card-body {
    padding: 0.25rem 1rem 0.25rem 1rem !important;
}
/* Make the search form itself more compact */
.card.mb-4:first-of-type {
    min-height: 60px !important;
    height: auto !important;
}
/* Target the form inside the search card */
.card.mb-4:first-of-type form {
    margin: 0 !important;
    padding: 0 !important;
}
/* Make the input group more compact */
.card.mb-4:first-of-type .input-group {
    margin: 0 !important;
}
/* Remove any extra spacing from Bootstrap row/col classes in search */
.card.mb-4:first-of-type .row {
    margin: 0 !important;
}
.card.mb-4:first-of-type .col-12 {
    padding: 0 !important;
}
/* Target the calendar card specifically */
.card.mb-4[style*="background: #fff"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* Remove gap between consecutive cards */
.card.mb-4 + .card.mb-4 {
    margin-top: 0 !important;
}
/* Target container spacing */
.container-fluid.mt-4 {
    padding-top: 0.25rem !important;
    padding-bottom: 0 !important;
}
/* Calendar specific containers */
.calendar-main-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.calendar-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* Remove any Bootstrap default spacing */
.card-body.p-0 {
    padding: 0 !important;
}
/* Target the specific form layouts for different user types */
.bg-light.p-4.rounded.shadow-sm.mb-3 {
    margin-bottom: 0 !important;
    padding: 0.5rem !important;
}
.alert.alert-info.mb-0 {
    margin-bottom: 0 !important;
    padding: 0.5rem !important;
}
/* Force no gap between any two consecutive cards */
.card + .card {
    margin-top: 0 !important;
}
/* Override any inline styles that might add spacing */
div[style*="margin: 0 auto"] + div[style*="margin: 0 auto"] {
    margin-top: 0 !important;
}

/* Fix analyze cards to match content height - remove any remaining height constraints */
.card.text-center,
.card.text-center .card-body,
#summary-cards .card,
#summary-cards .card .card-body {
    height: auto !important;
    min-height: auto !important;
}

/* Ensure all analyze dashboard cards match their content */
.advanced-monitoring .card,
.advanced-monitoring .card .card-body {
    height: auto !important;
    min-height: auto !important;
}

/* Override any Bootstrap or other CSS that might be setting card heights */
.card,
.card-body {
    height: auto !important;
    min-height: auto !important;
}

/* Specific override for analyze dashboard cards */
.container .card.text-center,
.container .card.text-center .card-body {
    height: auto !important;
    min-height: auto !important;
}

/* Fix Quick Live Analysis card to match content height */
.quick-live-analysis-card,
.quick-live-analysis-card .card-body {
    height: auto !important;
    min-height: auto !important;
}

