/* Auto-Bot Frontend - Gold & Black Theme */

:root {
    --gold-primary: #FFD700;
    --gold-dark: #B8860B;
    --gold-light: #FFF8DC;
    --black-bg: #0A0A0A;
    --black-card: #1A1A1A;
    --black-hover: #2A2A2A;
    --bg-secondary: #2A2A2A;
    --text-white: #FFFFFF;
    --text-gray: #CCCCCC;
    --success: #00C853;
    --danger: #FF1744;
    --warning: #FFC400;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #0A0A0A 100%);
    background-attachment: fixed;
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--black-card) 0%, #000000 100%);
    padding: 1rem 2rem;
    border-bottom: 2px solid var(--gold-primary);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2), 0 2px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--gold-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--gold-dark);
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.navbar-nav > li {
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--gold-primary);
    background: var(--black-hover);
}

.nav-link.active {
    color: var(--gold-primary);
    background: var(--black-hover);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--gold-primary);
}

/* Dropdown Menu */
.navbar-nav .dropdown {
    position: relative;
}

/* Add invisible bridge between nav item and dropdown */
.navbar-nav .dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    display: none;
}

.navbar-nav .dropdown:hover::before {
    display: block;
}

.navbar-nav .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: var(--black-card);
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 215, 0, 0.15);
    z-index: 1000;
    padding: 0.75rem 0;
}

.navbar-nav .dropdown:hover .dropdown-content,
.navbar-nav .dropdown-content:hover {
    display: block;
    animation: slideDown 0.2s ease-out;
}

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

.navbar-nav .dropdown-content a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
}

.navbar-nav .dropdown-content a:hover {
    background: var(--black-hover);
    color: var(--gold-primary);
    border-left-color: var(--gold-primary);
}

.navbar-nav .dropdown > .nav-link::after {
    content: ' ▾';
    font-size: 0.75em;
    margin-left: 0.3rem;
    opacity: 0.7;
}

/* Container */
.container {
    max-width: 98%;
    margin: 0 auto;
    padding: 1rem;
}

/* Cards */
.card {
    background: var(--black-card);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-header {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--gold-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gold-dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--black-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--gold-dark);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--gold-primary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gold-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: -1rem;
    padding: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: var(--black-hover);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 0.6rem 0.5rem;
    text-align: left;
    color: var(--gold-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--gold-dark);
    white-space: nowrap;
    font-size: 0.8rem;
}

td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    vertical-align: top;
}

/* Compact specific columns */
td:first-child, th:first-child {
    width: 40px;
    text-align: center;
    padding: 0.4rem 0.3rem;
}

/* Compact details/summary */
details summary {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
}

details[open] summary {
    margin-bottom: 0.3rem;
}

/* Make small text even smaller in tables */
table small {
    font-size: 0.7rem;
}

/* Optimize button sizing in tables */
table .btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
}

tbody tr {
    transition: background 0.2s ease;
}

tr:hover {
    background: var(--black-hover);
}

.cookie-row.expiring {
    background: rgba(255, 196, 0, 0.08);
}

.cookie-row.expired {
    background: rgba(255, 23, 68, 0.08);
}

.cookie-row.expiring:hover {
    background: rgba(255, 196, 0, 0.15);
}

.cookie-row.expired:hover {
    background: rgba(255, 23, 68, 0.15);
}

.cookie-warning {
    display: inline-block;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    background: rgba(255, 196, 0, 0.12);
    border: 1px solid rgba(255, 196, 0, 0.5);
    color: var(--warning);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--gold-primary);
    color: var(--black-bg);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #00A347;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #D50032;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--black-hover);
    color: var(--text-white);
    border: 1px solid var(--gold-dark);
}

.btn-secondary:hover {
    border-color: var(--gold-primary);
    background: #2F2F2F;
    transform: translateY(-1px);
}

/* Badges */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-pending {
    background: var(--warning);
    color: var(--black-bg);
}

.badge-failed {
    background: var(--danger);
    color: white;
}

.badge-retry {
    background: #FF9800;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.badge-mismatch {
    background: #FF6B00;
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    margin-left: 0.3rem;
}

.badge-active {
    background: var(--gold-primary);
    color: var(--black-bg);
}

.badge-inactive {
    background: var(--text-gray);
    color: var(--black-bg);
}

.badge-expiring {
    background: var(--warning);
    color: var(--black-bg);
}

.badge-expired {
    background: var(--danger);
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gold-primary);
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--black-hover);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    color: var(--text-white);
    font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--black-card);
    padding: 2rem;
    border-radius: 8px;
    border: 2px solid var(--gold-primary);
    max-width: 500px;
    width: 90%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(0, 200, 83, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 23, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loader {
    border: 4px solid var(--black-hover);
    border-top: 4px solid var(--gold-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-gray);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--gold-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-slider:hover {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    padding: 0.5rem 0.8rem;
    background: var(--black-hover);
    color: var(--text-white);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 36px;
    text-align: center;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--gold-dark);
    color: var(--black-bg);
}

.page-btn.active {
    background: var(--gold-primary);
    color: var(--black-bg);
    font-weight: 600;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.ellipsis {
    border: none;
    cursor: default;
    pointer-events: none;
}

.pagination-info {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    width: 100%;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-selector select {
    width: auto;
    padding: 0.5rem;
}

/* Page Title */
h1 {
    margin-bottom: 1rem;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--gold-primary);
    color: var(--black-bg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--black-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark) 0%, var(--gold-primary) 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
}

/* Code/Monospace Text */
code {
    background: var(--black-hover);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Improved Focus States */
button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

/* Loading Spinner */
.loader {
    border: 4px solid var(--black-hover);
    border-top: 4px solid var(--gold-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}


