
/* 
 * ========================================================
 * Admin Manager Styles
 * ========================================================
 */

/* Login Modal */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Higher than dashboard (10000) */
}

.admin-modal-overlay.active {
    display: flex;
}

.admin-login-box {
    background: #1e1e1e;
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.admin-input:focus {
    border-color: #3b82f6;
}

.admin-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap; /* Prevent text wrapping */
}

.admin-btn:hover {
    background: #2563eb;
}

.admin-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.admin-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Home Panel Styles */
.admin-home-panel {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.admin-home-grid {
    animation: fadeIn 0.4s ease-out;
}

.admin-log-card #admin-logs-container table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-log-card #admin-logs-container::-webkit-scrollbar {
    width: 6px;
}

.admin-log-card #admin-logs-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.admin-log-card #admin-logs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Existing styles... */
/* Dashboard */
.admin-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.admin-dashboard.active {
    transform: translateY(0);
}

.admin-header {
    padding: 1rem 2rem;
    background: #1e1e1e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on mobile */
    gap: 1rem;
}

/* Header Title & Tabs */
.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap; /* Allow tabs to wrap */
}

.admin-tab {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.admin-tab.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Header Actions */
.admin-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Mobile optimizations for header */
/* Backup Panel Responsive */
.admin-backup-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .admin-backup-container {
        grid-template-columns: 1fr;
    }
    
    .admin-backup-config {
        order: -1; /* Config on top for mobile */
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header-left {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .admin-header-left h2 {
        text-align: center;
        font-size: 1.25rem;
    }

    .admin-tabs {
        justify-content: center;
    }

    .admin-header-actions {
        justify-content: center;
        margin-top: 0.5rem;
    }

    .admin-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.admin-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* User Management Mobile Cards */
.admin-user-cards {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

.admin-user-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-user-card-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-card-user img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.admin-user-card-user strong {
    font-size: 1.1rem;
    color: white;
}

.admin-user-card-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.admin-user-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 0.75rem;
}

.admin-user-card-info div {
    display: flex;
    gap: 0.5rem;
}

.admin-user-card-info span:first-child {
    color: rgba(255, 255, 255, 0.4);
    min-width: 60px;
}

.admin-user-card-role {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.admin-user-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .admin-users-table-container {
        display: none;
    }
    .admin-user-cards {
        display: flex;
    }
    .admin-content {
        padding: 0.75rem;
    }
}

#jsoneditor {
    width: 100%;
    height: 100%;
}

/* JSONEditor Dark Theme Override */
.jsoneditor {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.jsoneditor-menu {
    background-color: #1e1e1e !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
.jsoneditor-contextmenu {
    background-color: #1e1e1e !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.jsoneditor-text, .jsoneditor-tree {
    color: #e0e0e0 !important;
}
.jsoneditor-field, .jsoneditor-value {
    color: #e0e0e0 !important;
}

/* Theme Panel */
.admin-theme-panel {
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
    color: white;
}

.admin-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-theme-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.admin-theme-preview {
    height: 60px;
    width: 100%;
}

.admin-theme-card-header {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-theme-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-theme-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
}

.admin-theme-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.admin-theme-badge.active {
    background: rgba(255, 255, 255, 0.9);
    color: black;
    font-weight: 600;
}

.admin-theme-actions {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-theme-editor {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 0.75rem;
}

.admin-theme-editor label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(var(--color-neutral-white-rgb), 0.8);
    font-size: 0.875rem;
}

.admin-theme-editor input[type="color"] {
    width: 44px;
    height: 32px;
    border: 1px solid rgba(var(--color-neutral-white-rgb), 0.18);
    background: transparent;
    border-radius: 0.5rem;
    padding: 0;
}

.admin-theme-editor-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.75rem;
}

.admin-theme-editor-actions .admin-btn {
    width: auto;
}

/* Upload History Popover */
.upload-history-popover {
    position: fixed;
    top: 4rem;
    right: 2rem;
    width: 320px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

/* Mobile adjustment for popover */
@media (max-width: 768px) {
    .upload-history-popover {
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        max-height: 60vh;
    }
}

.upload-history-popover .popover-header {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: white;
}

.upload-history-popover .close-btn {
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
}

.upload-history-popover .close-btn:hover {
    opacity: 1;
}

.upload-history-popover .popover-content {
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1;
}

.upload-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.upload-history-item:last-child {
    border-bottom: none;
}

.upload-history-item .preview {
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
}

.upload-history-item .info {
    flex: 1;
    min-width: 0;
}

.upload-history-item .name {
    font-size: 0.8rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.upload-history-item .url {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-history-item .copy-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.upload-history-item .copy-btn:hover {
    background: #2563eb;
}

/* Admin Notification Popup */
.admin-notification-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10002;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 191, 36, 0.3); /* Amber border */
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 320px;
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    color: white;
}

.admin-notification-popup.hidden {
    display: none;
}

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

.admin-notification-icon {
    width: 36px;
    height: 36px;
    background: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    flex-shrink: 0;
}

.admin-notification-content {
    flex: 1;
}

.admin-notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.admin-notification-message {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
    line-height: 1.4;
}

.admin-notification-action {
    font-size: 0.85rem;
    color: #fbbf24;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.admin-notification-action:hover {
    opacity: 0.8;
}

.admin-notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 0.85rem;
}

.admin-notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}
