/* ArcGIS FileGDB Studio & Editor - Styling */
:root {
    --bg-main: #0B0F17;
    --bg-panel: #111827;
    --bg-card: #1E293B;
    --bg-hover: #334155;
    --border-color: #334155;
    --accent-blue: #3B82F6;
    --accent-indigo: #6366F1;
    --accent-emerald: #10B981;
    --accent-amber: #F59E0B;
    --accent-rose: #EF4444;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

code, pre, .font-mono {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #0F172A;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Strict Layout Separation: Full Height Sidebar & Flush Workspace */
#sidebar {
    width: 20rem;
    min-width: 20rem;
    max-width: 20rem;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 1 0%;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#workspaceContainer {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#tableSection {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Table styles */
.gdb-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.gdb-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #111827;
    box-shadow: 0 1px 0 0 #334155;
}

.cell-editable {
    transition: all 0.15s ease;
    cursor: default;
    position: relative;
}

.edit-mode-active .cell-editable {
    cursor: cell;
}

.edit-mode-active .cell-editable:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
    outline: 1px solid rgba(59, 130, 246, 0.4);
}

.cell-edited {
    background-color: rgba(245, 158, 11, 0.18) !important;
    position: relative;
    border-left: 3px solid #F59E0B !important;
}

.cell-edited::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 5px;
    height: 5px;
    background-color: #F59E0B;
    border-radius: 50%;
}

.cell-active-edit input, .cell-active-edit select {
    background: #0F172A;
    color: #F8FAFC;
    border: 2px solid #F59E0B;
    border-radius: 4px;
    padding: 4px 8px;
    width: 100%;
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* Drag and Drop Zone */
.dropzone-active {
    border-color: #3B82F6 !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
    transform: scale(1.01);
}

/* Leaflet Map & Popup Card Overrides (Fit to content) */
.leaflet-container {
    background-color: #0F172A !important;
    font-family: inherit;
    width: 100% !important;
    height: 100% !important;
}

.leaflet-popup-content-wrapper {
    background: #111827 !important;
    color: #F8FAFC !important;
    border: 1px solid #334155;
    border-radius: 12px !important;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.7) !important;
    padding: 0 !important;
    min-width: 280px;
    max-width: 480px;
}

.leaflet-popup-tip {
    background: #111827 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.5;
    max-height: 380px;
    overflow-y: auto;
    padding: 14px 16px !important;
}

/* Pulse animation for dirty/unsaved counter */
@keyframes badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

.animate-pulse-subtle {
    animation: badge-pulse 2s infinite ease-in-out;
}
