/**
 * Developer Bar - Super Admin Only
 * Server diagnostics, database viewer, and developer tools
 */

/* Developer Footer Bar - Matches Admin Header Bar Style */
.dev-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background: var(--dark);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    color: var(--white);
    font-size: 14px;
}

body.dev-bar-visible .dev-bar {
    display: flex;
}

/* Developer Bar Items */
.dev-bar-items {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
}

.dev-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: default;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.dev-bar-item i {
    font-size: 14px;
    color: var(--primary-color);
}

.dev-bar-item .label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.dev-bar-item .value {
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 15px;
}

/* Status indicators */
.dev-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.dev-status-dot.active {
    background: #43e97b;
    box-shadow: 0 0 6px #43e97b;
}

.dev-status-dot.warning {
    background: #f5576c;
    box-shadow: 0 0 6px #f5576c;
}

/* Developer Bar Buttons */
.dev-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.dev-bar-btn {
    padding: 10px 18px;
    background: rgba(64, 224, 208, 0.15);
    border: 1px solid rgba(64, 224, 208, 0.4);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-bar-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.dev-bar-btn i {
    font-size: 12px;
}

/* Developer Panels */
.dev-panel {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 90%;
    max-width: 1200px;
    max-height: 70vh;
    background: var(--dark);
    border: 2px solid var(--primary-color);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: transform 0.3s ease;
    display: none;
    flex-direction: column;
}

.dev-panel.active {
    display: flex;
    transform: translateX(-50%) translateY(0);
}

/* Panel Header */
.dev-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--dark-light);
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
}

.dev-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.dev-panel-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.dev-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.dev-panel-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Panel Content */
.dev-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Server Diagnostics Grid */
.dev-diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dev-diagnostic-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
}

.dev-diagnostic-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-diagnostic-header i {
    color: var(--primary-color);
}

.dev-diagnostic-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    font-family: 'Courier New', monospace;
}

.dev-diagnostic-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* Database Table Viewer */
.dev-db-viewer {
    display: flex;
    gap: 20px;
    height: 100%;
}

.dev-db-sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
}

.dev-db-sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dev-db-table-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dev-db-table-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dev-db-table-item:hover {
    background: rgba(64, 224, 208, 0.1);
    border-color: var(--primary-color);
}

.dev-db-table-item.active {
    background: rgba(64, 224, 208, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dev-db-table-item i {
    font-size: 12px;
}

.dev-db-table-count {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Database Table Content */
.dev-db-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dev-db-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dev-db-search {
    flex: 1;
    max-width: 300px;
}

.dev-db-search input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--white);
    font-size: 13px;
}

.dev-db-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dev-db-actions {
    display: flex;
    gap: 8px;
}

.dev-db-btn {
    padding: 8px 12px;
    background: rgba(64, 224, 208, 0.1);
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dev-db-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: var(--primary-color);
}

.dev-db-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.dev-db-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Database Table */
.dev-db-table-container {
    flex: 1;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.dev-db-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dev-db-table thead {
    position: sticky;
    top: 0;
    background: var(--dark-light);
    z-index: 10;
}

.dev-db-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid rgba(64, 224, 208, 0.3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-db-table td {
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dev-db-table tr:hover td {
    background: rgba(64, 224, 208, 0.05);
}

.dev-db-table td.editable {
    cursor: pointer;
    position: relative;
}

.dev-db-table td.editable:hover {
    background: rgba(64, 224, 208, 0.1);
}

.dev-db-cell-actions {
    display: flex;
    gap: 4px;
}

.dev-db-cell-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.dev-db-cell-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    color: var(--primary-color);
}

/* Edit Modal */
.dev-edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: var(--dark);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: none;
}

.dev-edit-modal.active {
    display: block;
}

.dev-edit-modal-header {
    padding: 16px 20px;
    background: var(--dark-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-edit-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
}

.dev-edit-modal-content {
    padding: 20px;
}

.dev-form-group {
    margin-bottom: 16px;
}

.dev-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-form-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--white);
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.dev-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.dev-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.dev-edit-modal-footer {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Overlay for modals */
.dev-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
}

.dev-modal-overlay.active {
    display: block;
}

/* Adjust main content when dev bar is visible */
body.dev-bar-visible .main-content {
    min-height: calc(100vh - 50px);
}

/* Responsive */
@media (max-width: 1200px) {
    .dev-bar-items {
        gap: 12px;
    }
    
    .dev-bar-item .label {
        display: none;
    }
    
    .dev-panel {
        width: 95%;
    }
    
    .dev-db-viewer {
        flex-direction: column;
    }
    
    .dev-db-sidebar {
        width: 100%;
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .dev-bar {
        display: none !important;
    }
    
    body.dev-bar-visible .main-content {
        min-height: 100vh;
        padding-bottom: 20px;
    }
    
    body.dev-bar-visible .sidebar {
        height: 100vh;
    }
    
    body.dev-bar-visible .chat-panel {
        height: calc(100vh - 73px);
    }
    
    .dev-panel {
        max-height: 60vh;
    }
    
    .dev-diagnostics-grid {
        grid-template-columns: 1fr;
    }
}
