/* Poker Elephant - Main Stylesheet & Theme System (Compact Scaled) */

:root {
  --bg-dark: #0b0f19;
  --bg-panel: rgba(18, 26, 43, 0.85);
  --bg-card: rgba(26, 38, 64, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #6366f1; /* Indigo */
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);

  --suit-spades: #94a3b8;
  --suit-hearts: #f87171;
  --suit-diamonds: #60a5fa;
  --suit-clubs: #4ade80;

  --filter-include: #10b981;
  --filter-exclude: #ef4444;
  --filter-ignore: #6b7280;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 15% 15%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism panel container */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 6px 24px 0 rgba(0, 0, 0, 0.35);
}

/* Compact Header Navbar */
header {
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.95);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.5px;
}

.brand-icon {
  font-size: 1.2rem;
  background: linear-gradient(135deg, #6366f1, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-name {
  background: linear-gradient(135deg, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.775rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Main Workspace Grid (Compact Scaled) */
/* Main Application Layout Container */
.main-layout {
  flex: 1;
  display: flex;
  height: calc(100vh - 42px);
  overflow: hidden;
  gap: 10px;
  padding: 10px;
}

#sidebarContainer {
  width: 240px;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.workspace-area {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 10px;
  height: 100%;
  overflow: hidden;
}

/* Left Sidebar - Presets & Saved Ranges */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.preset-tree {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.folder-item {
  margin-bottom: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.folder-item.dragging {
  opacity: 0.35;
  border: 1px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.folder-item.drag-over {
  border-top: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.folder-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.folder-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.folder-header.drag-over {
  background: rgba(99, 102, 241, 0.25) !important;
  outline: 1px dashed var(--accent-primary);
  border-radius: 5px;
}

.preset-item.drag-over {
  border-bottom: 2px solid var(--accent-primary);
  background: rgba(99, 102, 241, 0.15) !important;
}

.preset-tree.drag-over-root {
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed var(--accent-primary);
  border-radius: 6px;
}

.folder-header.dragging,
.preset-item.dragging {
  opacity: 0.35;
}

.folder-children {
  padding-left: 14px;
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.folder-children.open {
  display: flex;
}

.preset-item {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.775rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
  position: relative;
}

.preset-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.preset-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-weight: 600;
}

.folder-header .actions,
.preset-item .actions {
  display: none;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(4px);
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  align-items: center;
  gap: 3px;
  z-index: 10;
}

.folder-header:hover .actions,
.preset-item:hover .actions {
  display: flex;
}

.action-btn {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.675rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  cursor: pointer;
}

.action-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}

.action-btn.delete:hover {
  background: #ef4444;
}

/* Center Panel - Dual Matrix & Board Inputs */
.center-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  overflow-y: auto;
}

/* Right Panel - Stats & Dynamic Filters */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 480px;
  padding: 18px;
  border-radius: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Automatic Proportional UI Scaling for Laptop Displays & DPI Scaling (17" and below) */
@media screen and (max-width: 2200px) {
  body {
    zoom: 0.88;
  }
}

@media screen and (max-width: 1800px) {
  body {
    zoom: 0.78;
  }
}

@media screen and (max-width: 1550px) {
  body {
    zoom: 0.70;
  }
}

@media screen and (max-width: 1366px) {
  body {
    zoom: 0.62;
  }
}
