:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --glass-bg: rgba(0, 0, 0, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: var(--glass-shadow);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: white !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    text-shadow: 0 0 10px rgba(240, 147, 251, 0.5);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    border-radius: 25px 0 0 25px;
    border: 2px solid var(--glass-border);
    border-right: none;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    border-radius: 0 25px 25px 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--glass-border);
    color: white;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 0 20px rgba(118, 75, 162, 0.5);
    transform: scale(1.05);
}

.result-item {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--glass-shadow);
}

.result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
    border-color: var(--accent-color);
}

.result-title {
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.result-title:hover {
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(240, 147, 251, 0.8);
}

.result-url {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.result-snippet {
    color: white;
    font-size: 0.95rem;
    line-height: 1.6;
}

.card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.card-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
    font-weight: 600;
    border-radius: 24px 24px 0 0;
    padding: 16px 20px;
}

.card-body {
    color: white;
    padding: 20px;
}

.card-title {
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-text {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.card a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.card a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.form-control {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
}

.form-control:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(240, 147, 251, 0.3);
    color: white;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Admin Sidebar - Modern Glassmorphism Design */
.admin-sidebar {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 100vh;
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    color: white;
    position: sticky;
    top: 0;
}

.admin-sidebar .sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    margin-bottom: 16px;
}

.admin-sidebar .sidebar-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.admin-sidebar .sidebar-header small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.admin-sidebar .nav {
    padding: 0 12px;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 14px 18px;
    margin-bottom: 6px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.admin-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover {
    background: rgba(102, 126, 234, 0.15);
    color: white;
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(4px);
}

.admin-sidebar .nav-link:hover i {
    color: var(--accent-color);
    transform: scale(1.1);
}

.admin-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
}

.admin-sidebar .nav-link.active i {
    color: white;
}

/* User Dashboard Sidebar */
.user-sidebar {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 100vh;
    border-right: 1px solid rgba(102, 126, 234, 0.2);
    color: white;
    position: sticky;
    top: 0;
}

.user-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 14px 18px;
    margin-bottom: 6px;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.user-sidebar .nav-link:hover {
    background: rgba(102, 126, 234, 0.15);
    color: white;
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(4px);
}

.user-sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
}

.table {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    overflow: hidden;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.table thead th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9)) !important;
    color: white !important;
    border-bottom: 2px solid rgba(102, 126, 234, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table tbody tr {
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    color: white;
    transition: all 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.08) !important;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

.table tbody td {
    color: rgba(255, 255, 255, 0.95) !important;
    vertical-align: middle;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.table a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.table a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.suggestions-box {
    position: absolute;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 6px rgba(31, 38, 135, 0.28);
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px 24px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
}

.suggestion-item:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--accent-color);
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
    padding: 15px 0;
    z-index: 1000;
}

footer a {
    color: var(--accent-color);
    transition: all 0.3s ease;
}

footer a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.alert {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: white;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.5);
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    border-color: rgba(23, 162, 184, 0.5);
}

.btn-close {
    filter: brightness(0) invert(1);
}

.main-content {
    flex: 1;
    padding: 20px 0 80px 0;
}

.dropdown-menu {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: var(--glass-shadow);
}

.dropdown-item {
    color: white;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--accent-color);
}

/* Force dark backgrounds for all Bootstrap components */
.table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

.form-select {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.form-select option {
    background: #1a1a2e !important;
    color: white !important;
}

.btn-outline-primary {
    color: white !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    color: white !important;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.badge {
    background: rgba(102, 126, 234, 0.5) !important;
    color: white !important;
}

.pagination .page-link {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

.pagination .page-link:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    color: white !important;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    border-color: transparent !important;
}

input, select, textarea {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

input:focus, select:focus, textarea:focus {
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
}

.table-responsive {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Table container for scrollable tables */
.table-container {
    max-height: 500px;
    overflow-y: auto;
}

.table-container .table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Word wrap for search results */
.result-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.result-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.result-url {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.result-snippet {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Animation for homepage logo */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.bi-search {
    animation: rotate 3s linear infinite;
    display: inline-block;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* FORCE ALL TABLE BACKGROUNDS TO BE DARK - OVERRIDE BOOTSTRAP */
table,
.table,
.table-responsive,
.table > thead,
.table > tbody,
.table > tfoot,
.table tr,
.table td,
.table th,
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr,
.table > thead > tr > th,
.table > tbody > tr > td,
.table > tfoot > tr > td {
    background-color: transparent !important;
    color: white !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(102, 126, 234, 0.05) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

/* Ensure table data is readable */
.table tbody tr td,
.table tbody tr th,
.table thead tr th {
    color: rgba(255, 255, 255, 0.95) !important;
    background-color: transparent !important;
    border-color: rgba(102, 126, 234, 0.2) !important;
}

/* Override Bootstrap's bg-white and bg-light classes */
.bg-white,
.bg-light,
[class*="bg-white"],
[class*="bg-light"] {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

/* Admin specific table fixes */
.admin-sidebar .table,
.admin-sidebar table {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Force all white backgrounds to be dark */
[style*="background: white"],
[style*="background: #fff"],
[style*="background-color: white"],
[style*="background-color: #fff"] {
    background: rgba(0, 0, 0, 0.6) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
}
