/* Admin Panel Styles */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

:root {
    --admin-primary: #00ffff;
    --admin-bg: #0a0a0a;
    --admin-text: #e0e0e0;
    --admin-border: rgba(0, 255, 255, 0.3);
    --admin-hover: rgba(0, 255, 255, 0.1);
    --admin-success: #00ff88;
    --admin-error: #ff4444;
    --admin-warning: #ffaa00;
}

/* Main Container */
.admin-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #001428 0%, #000a14 100%);
    padding: 20px;
    font-family: 'Orbitron', sans-serif;
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 60px;
}

/* Access Denied */
.access-denied {
    text-align: center;
    padding: 100px 20px;
}

.access-denied h1 {
    color: var(--admin-error);
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.access-denied p {
    color: var(--admin-text);
    font-size: 1.1rem;
}

/* Admin Panel */
.admin-panel {
    animation: fadeIn 0.5s ease;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--admin-border);
}

.admin-header h1 {
    color: var(--admin-primary);
    font-size: 2rem;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.btn-download-logs {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0.1) 100%);
    border: 1px solid var(--admin-primary);
    color: var(--admin-primary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-download-logs:hover {
    background: var(--admin-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--admin-border);
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--admin-primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--admin-primary) 0%, #00cccc 100%);
    color: #000;
    border-color: var(--admin-primary);
    font-weight: bold;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

/* Tab Content */
.tab-content {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    padding: 25px;
    backdrop-filter: blur(10px);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--admin-primary);
    font-size: 1.1rem;
}

.loading::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    background: rgba(0, 255, 255, 0.1);
    color: var(--admin-primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.admin-table td {
    color: var(--admin-text);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
}

.admin-table tbody tr {
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

.admin-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.2);
}

.admin-table tbody tr:nth-child(even):hover {
    background: rgba(0, 255, 255, 0.08);
}

/* Role Select */
.role-select {
    background: rgba(0, 0, 0, 0.5);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.3s ease;
}

.role-select:hover {
    border-color: var(--admin-primary);
}

.role-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.role-select option {
    background: #001428;
    color: var(--admin-text);
}

/* Small Button */
.btn-small {
    background: linear-gradient(135deg, var(--admin-primary) 0%, #00cccc 100%);
    color: #000;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-small:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.btn-small:active {
    transform: scale(0.98);
}

/* Webhook Stats Section */
.webhook-stats {
    margin-bottom: 30px;
}

.webhook-stats h3,
.webhooks-tab h3 {
    color: var(--admin-primary);
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--admin-border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 255, 255, 0.05) 100%);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--admin-primary);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.2);
}

.stat-name {
    color: var(--admin-text);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.stat-count {
    color: var(--admin-primary);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Tab-specific styles */
.users-tab,
.emails-tab,
.pagehits-tab,
.webhooks-tab {
    animation: slideIn 0.3s ease;
}

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

/* Status indicators */
.admin-table td:last-child {
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-content {
        padding-top: 80px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }

    .tab-bar {
        justify-content: center;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .tab-content {
        padding: 15px;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .admin-page {
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-count {
        font-size: 1.5rem;
    }
}

/* Detail Row Styles */
.detail-row {
    background: rgba(0, 255, 255, 0.03) !important;
}

.detail-row:hover {
    background: rgba(0, 255, 255, 0.05) !important;
}

.detail-row td {
    padding: 0 !important;
    border-bottom: 2px solid var(--admin-border);
}

.detail-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 15px;
}

.detail-section h4 {
    color: var(--admin-primary);
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.json-content {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin: 0;
    color: var(--admin-text);
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    background: rgba(0, 0, 0, 0.5);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    min-width: 180px;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--admin-primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.filter-select option {
    background: #001428;
    color: var(--admin-text);
    padding: 8px;
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        min-width: 100%;
    }
}
