/* === Admin Legends Page Styles === */
.admin-page {
    background-color: #0b0f14;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 204, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 212, 0.08) 0%, transparent 40%);
    color: #f1f5f9;
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 204, 255, 0.05);
}

/* Authentication Overlay */
.admin-auth-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.admin-auth-card {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.auth-icon {
    font-size: 3rem;
    color: #00CCFF;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 204, 255, 0.4);
}

.admin-auth-card input {
    width: 100%;
    padding: 15px;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    text-align: center;
}

.admin-auth-card input:focus {
    outline: none;
    border-color: #00CCFF;
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.2);
}

/* Layout */
.admin-header {
    margin-bottom: 40px;
    text-align: center;
}

.admin-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00CCFF, #FF00D4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.admin-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 992px) {
    .admin-layout {
        flex-direction: column;
    }
}

.admin-form-section {
    flex: 6;
    min-width: 0;
}

.admin-grid-section {
    flex: 4;
    min-width: 0;
}

@media (max-width: 992px) {

    .admin-form-section,
    .admin-grid-section {
        width: 100%;
        max-width: 100%;
    }
}

/* Forms */
.admin-form-section h2, .admin-grid-section h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 0 8px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    color: white;
    font-family: inherit;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00CCFF;
    border-image: linear-gradient(90deg, #00CCFF, #FF00D4) 1;
    box-shadow: 0 5px 20px rgba(0, 204, 255, 0.4), inset 0 -2px 10px rgba(0, 204, 255, 0.1);
    background: rgba(0, 204, 255, 0.02);
}

::placeholder {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 300;
}

/* Era Neon Selector */
.era-selector-neon {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.era-option {
    flex: 1;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.era-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.era-icon {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 5px;
    opacity: 0.5;
    transition: 0.3s;
    filter: grayscale(100%);
}

.era-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    transition: 0.3s;
}

.era-option input:checked ~ .era-icon {
    opacity: 1;
    filter: grayscale(0%);
    text-shadow: 0 0 15px rgba(0, 204, 255, 0.6);
    transform: scale(1.1);
}

.era-option input:checked ~ .era-label {
    color: #00CCFF;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.3);
}

.form-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 30px 0;
}

/* Dynamic Games Block */
.game-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
}

.game-block-remove {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: 0.2s;
}

.game-block-remove:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Admin Feed (Scrollable List) */
.admin-table-wrapper {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.admin-table-wrapper::-webkit-scrollbar {
    width: 6px;
}
.admin-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
.admin-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 204, 255, 0.3);
    border-radius: 10px;
}
.admin-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 204, 255, 0.5);
}

.admin-feed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: 0.3s;
    position: relative;
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(0, 204, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.feed-img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
    margin-left: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feed-info {
    flex: 1;
}

.feed-name {
    font-weight: bold;
    font-size: 1.05rem;
    color: #f1f5f9;
}

.feed-sub {
    font-size: 0.8rem;
    color: #94a3b8;
}

.feed-actions {
    opacity: 0;
    transition: 0.3s;
    display: flex;
    gap: 10px;
}

.feed-item:hover .feed-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    margin-left: 10px;
    font-size: 1.1rem;
    transition: 0.2s;
}

.action-btn.edit:hover { color: #00CCFF; }
.action-btn.delete:hover { color: #ef4444; }

/* Buttons Overrides */
.cr-btn, .cr-topbar-btn.primary {
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: 0.3s;
    border: none;
    background: linear-gradient(135deg, #00CCFF 0%, #FF00D4 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 4px 15px rgba(255, 0, 212, 0.3);
}

.cr-btn:hover, .cr-topbar-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 255, 0.5);
    background: linear-gradient(135deg, #00b3e6 0%, #e600bf 100%);
}

.cr-topbar-btn.primary {
    padding: 12px 30px;
}

.outline-primary {
    background: transparent;
    border: 1px solid #00CCFF;
    color: #00CCFF;
    box-shadow: none;
    text-shadow: none;
}

.outline-primary:hover {
    background: rgba(0, 204, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
    transform: none;
}

.outline-danger {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    box-shadow: none;
    text-shadow: none;
}

.outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    transform: none;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* Custom Image Upload Zone */
.neon-upload-zone {
    border: 2px dashed rgba(0, 204, 255, 0.3);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    background: rgba(0, 204, 255, 0.02);
    margin-top: 5px;
    overflow: hidden;
}

.neon-upload-zone:hover, .neon-upload-zone:focus-within {
    border-color: #FF00D4;
    background: rgba(255, 0, 212, 0.05);
    box-shadow: 0 0 20px rgba(255, 0, 212, 0.2) inset;
}

.hidden-upload {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.upload-icon {
    font-size: 2.5rem;
    color: #00CCFF;
    transition: 0.3s;
    filter: drop-shadow(0 0 5px rgba(0,204,255,0.5));
}

.neon-upload-zone:hover .upload-icon {
    color: #FF00D4;
    transform: scale(1.1) translateY(-3px);
    filter: drop-shadow(0 0 10px rgba(255,0,212,0.8));
}

.upload-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: 0.3s;
}

.neon-upload-zone:hover .upload-text {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,0,212,0.5);
}

/* ============================================
   BOARD POPUP MODAL (extracted from legends.css)
   ============================================ */
.board-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
}

.board-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.board-popup-panel {
    background: rgba(12, 12, 20, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 20px;
    width: min(550px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 204, 255, 0.15),
                0 0 120px rgba(255, 0, 212, 0.1);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-popup-overlay.active .board-popup-panel {
    transform: scale(1);
}

.board-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.board-popup-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.3);
}

.board-popup-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.board-popup-close:hover {
    background: rgba(255, 0, 212, 0.15);
    border-color: rgba(255, 0, 212, 0.4);
    color: #FF00D4;
}

.board-popup-body {
    padding: 20px;
}

/* ── Player Bar Styles (extracted from analyzer.css) ── */
.board-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(10, 14, 20, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 5;
    transition: all 0.3s ease;
}

.board-player-bar.top-bar {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.board-player-bar.bottom-bar {
    border-radius: 0 0 12px 12px;
    border-top: none;
}

.bp-avatar {
    width: 34px; height: 34px;
    border-radius: 50%; overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bp-name {
    font-family: 'Cairo', sans-serif;
    font-size: 14px; font-weight: 700; color: #e2e8f0;
}

.popup-board-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.popup-board-wrapper.is-flipped {
    flex-direction: column-reverse;
}

.board-popup-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.board-popup-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.board-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}

.board-nav-btn:hover:not(:disabled) {
    background: rgba(0, 204, 255, 0.1);
    border-color: rgba(0, 204, 255, 0.4);
    color: #00CCFF;
    transform: translateY(-2px);
}

.board-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.board-popup-move-info {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    font-family: 'Cairo', sans-serif;
}

/* ============================================
   ADMIN MESSAGE MODAL (Alert/Confirm)
   ============================================ */
.admin-msg-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.admin-msg-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-msg-panel {
    background: rgba(15, 15, 25, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: min(420px, 90vw);
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 
                0 0 40px rgba(255, 102, 204, 0.05);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-msg-overlay.active .admin-msg-panel {
    transform: translateY(0);
}

.admin-msg-icon {
    font-size: 3rem;
    color: #f97316;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.3));
}

.admin-msg-icon.error { color: #ef4444; filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.4)); }
.admin-msg-icon.success { color: #4ade80; filter: drop-shadow(0 0 15px rgba(74, 222, 128, 0.3)); }

.admin-msg-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.admin-msg-content p {
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 30px;
}

.admin-msg-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.admin-msg-actions .cr-btn {
    min-width: 120px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
}

/* Aesthetic Custom Dropdown Styles */
.aura-dropdown {
    position: relative;
    width: 100%;
}

.aura-dropdown-trigger {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 204, 255, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    padding-left: 40px;
    color: #f1f5f9;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    user-select: none;
    text-align: right;
}

.aura-dropdown-trigger::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #00CCFF;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.aura-dropdown.active .aura-dropdown-trigger {
    border-color: #00CCFF;
    box-shadow: 0 0 15px rgba(0, 204, 255, 0.3);
}

.aura-dropdown.active .aura-dropdown-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.aura-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    background: rgba(11, 15, 20, 0.98);
    border: 1px solid rgba(0, 204, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: dropIn 0.2s ease-out;
}

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

.aura-dropdown.active .aura-dropdown-menu {
    display: flex;
}

.aura-dropdown-item {
    padding: 12px 15px;
    color: #f1f5f9;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
}

.aura-dropdown-item:last-child {
    border-bottom: none;
}

.aura-dropdown-item:hover {
    background: rgba(0, 204, 255, 0.15);
    padding-right: 20px;
}

/* Result specific colors */
.aura-dropdown-item.color-win { color: #4ade80 !important; font-weight: bold; }
.aura-dropdown-item.color-loss { color: #f87171 !important; font-weight: bold; }
.aura-dropdown-item.color-draw { color: #94a3b8 !important; }

.aura-dropdown-item.color-win:hover { background: rgba(74, 222, 128, 0.15); }
.aura-dropdown-item.color-loss:hover { background: rgba(248, 113, 113, 0.15); }
.aura-dropdown-item.color-draw:hover { background: rgba(148, 163, 184, 0.15); }

/* Selected Trigger Colors */
.aura-dropdown-trigger[data-value="1-0"] { color: #4ade80 !important; font-weight: bold; }
.aura-dropdown-trigger[data-value="0-1"] { color: #f87171 !important; font-weight: bold; }
.aura-dropdown-trigger[data-value="1/2-1/2"] { color: #94a3b8 !important; }
