/* ============================================
   GLOBAL ADMIN SPECIFIC STYLES
   ============================================ */

/* ============================================
   EARTH GLOBE (Sidebar)
   Organic ocean/earth orb - says "Global Admin"
   ============================================ */

.admin-globe {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: 0 auto 14px auto;
    overflow: hidden;
}

.admin-globe:hover {
    transform: scale(1.08);
}

/* The orb itself - ocean base */
.admin-globe-orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        /* Atmospheric highlight */
        radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.25) 0%, transparent 40%),
        /* Ocean gradient */
        linear-gradient(
            180deg,
            #0ea5e9 0%,      /* Sky blue */
            #0284c7 30%,     /* Deep ocean */
            #0d9488 60%,     /* Teal */
            #0284c7 100%     /* Deep ocean */
        );
    box-shadow:
        0 0 30px rgba(14, 165, 233, 0.6),
        0 0 60px rgba(16, 185, 129, 0.4),
        inset 0 0 20px rgba(255,255,255,0.15);
    animation: admin-globe-glow 3s ease-in-out infinite;
}

/* Landmasses layer - drifts across like Earth rotating */
.admin-globe-land {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        /* Landmass shapes - emerald/teal patches */
        radial-gradient(ellipse 35% 25% at 20% 35%, rgba(16, 185, 129, 0.5) 0%, transparent 100%),
        radial-gradient(ellipse 20% 40% at 60% 25%, rgba(13, 148, 136, 0.4) 0%, transparent 100%),
        radial-gradient(ellipse 30% 20% at 75% 60%, rgba(16, 185, 129, 0.45) 0%, transparent 100%),
        radial-gradient(ellipse 25% 30% at 35% 70%, rgba(13, 148, 136, 0.35) 0%, transparent 100%);
    background-size: 200% 100%;
    animation: admin-land-drift 20s linear infinite;
}

/* Landmasses drift across - world turning */
@keyframes admin-land-drift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Breathing glow */
@keyframes admin-globe-glow {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(14, 165, 233, 0.6),
            0 0 60px rgba(16, 185, 129, 0.4),
            inset 0 0 20px rgba(255,255,255,0.15);
    }
    50% {
        box-shadow:
            0 0 40px rgba(14, 165, 233, 0.7),
            0 0 80px rgba(16, 185, 129, 0.5),
            inset 0 0 25px rgba(255,255,255,0.2);
    }
}

/* Hover intensifies */
.admin-globe:hover .admin-globe-orb {
    box-shadow:
        0 0 45px rgba(14, 165, 233, 0.8),
        0 0 90px rgba(16, 185, 129, 0.6),
        inset 0 0 30px rgba(255,255,255,0.25);
}


/* ============================================
   ADMIN SPLIT-VIEW PATTERN
   Single source of truth for all admin editor pages.
   Used by: Skills.razor, Knowledge.razor, Prompts

   Structure:
   .skills-split > .skills-sidebar + .skills-editor
   Sidebar: .sidebar-header > .search-box + .btn-add
            .sidebar-content > .category-section(s)
   Editor:  .editor-empty | .editor-footer + .editor-tabs + .editor-content
   ============================================ */

/* ===== SPLIT LAYOUT ===== */

.skills-split {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: 100%;
    background: #f8fafc;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */

.skills-sidebar {
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 6px;
}

.search-box i {
    color: #94a3b8;
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.btn-add {
    width: 36px;
    height: 36px;
    border: none;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add:hover {
    background: #2563eb;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

/* ===== CATEGORY SECTIONS ===== */

.category-section {
    border-bottom: 1px solid #f1f5f9;
}

.category-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-header:hover {
    background: #f1f5f9;
}

.category-header .chevron {
    font-size: 10px;
    transition: transform 0.15s;
}

.category-header.expanded .chevron {
    transform: rotate(90deg);
}

.category-icon {
    font-size: 12px;
    color: #3b82f6;
}

.category-name {
    flex: 1;
    text-align: left;
}

.category-count {
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.category-skills {
    padding: 4px 0;
}

/* ===== LIST ITEMS (sidebar items) ===== */

.skill-item {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-item:hover {
    background: #f1f5f9;
}

.skill-item.selected {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.skill-item.disabled {
    color: #94a3b8;
}

.skill-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-disabled-icon {
    font-size: 11px;
    color: #94a3b8;
}

.no-skills {
    padding: 8px 36px;
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

/* ===== EDITOR PANEL ===== */

.skills-editor {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.editor-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    gap: 12px;
}

.editor-empty i {
    font-size: 48px;
    opacity: 0.3;
    color: #3b82f6;
}

.editor-empty h3 {
    margin: 0;
    font-size: 18px;
    color: #334155;
}

.editor-empty p {
    margin: 0;
    font-size: 14px;
    max-width: 400px;
    text-align: center;
}

/* ===== EDITOR TABS ===== */

.editor-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.editor-tab:hover {
    background: #f1f5f9;
    color: #334155;
}

.editor-tab.active {
    background: #3b82f6;
    color: white;
}

/* ===== EDITOR CONTENT (scrollable) ===== */

.editor-content {
    flex: 1;
    overflow-y: auto;
    background: white;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.editor-content > .form-section {
    padding: 20px;
    overflow-y: auto;
}

/* ===== EDITOR FOOTER (action bar) ===== */

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.editor-footer-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.footer-actions {
    display: flex;
    gap: 8px;
}

/* ===== ADMIN FORMS ===== */

.form-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.mono-input, .mono-textarea {
    font-family: 'Consolas', 'Monaco', monospace !important;
    font-size: 13px !important;
    line-height: 1.6;
}

.prompt-textarea-full {
    width: 100%;
    flex: 1;
    border: none;
    padding: 16px 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: white;
    min-height: 0;
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.checkbox-row {
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* ===== CONFIRM & STATUS BARS ===== */

.confirm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 13px;
    flex-shrink: 0;
}

.confirm-bar.danger {
    background: #fef2f2;
    color: #dc2626;
    border-bottom: 1px solid #fecaca;
}

.confirm-bar div {
    display: flex;
    gap: 8px;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 13px;
    flex-shrink: 0;
}

.status-bar.success { color: #059669; background: #ecfdf5; }
.status-bar.error { color: #dc2626; background: #fef2f2; }

/* ===== ADMIN BUTTONS ===== */

.btn-primary, .btn-secondary, .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* ===== REFERENCE GRID (used by Skills permissions tab) ===== */

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.reference-item {
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.reference-item strong {
    display: block;
    font-size: 13px;
    color: #334155;
    margin-bottom: 2px;
}

.reference-item span {
    font-size: 12px;
    color: #64748b;
}

/* ===== LOADING STATE ===== */

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

/* ===== PLACEHOLDER (Coming Soon pages) ===== */

.gadmin-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    min-height: 400px;
}

.gadmin-placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: #dbeafe;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
}

.gadmin-placeholder h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.gadmin-placeholder p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.gadmin-placeholder .text-muted {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 16px;
}
