/* CSS Custom Properties for Notion-style theming */
:root[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f5;
  --bg-tertiary: #f1f1ef;
  --bg-hover: rgba(55, 53, 47, 0.08);
  --bg-selected: rgba(55, 53, 47, 0.16);
  
  /* Text colors */
  --text-primary: #37352f;
  --text-secondary: #787774;
  --text-tertiary: #9b9a97;
  --text-inverse: #ffffff;
  
  /* Borders */
  --border-primary: rgba(55, 53, 47, 0.16);
  --border-secondary: rgba(55, 53, 47, 0.09);
  
  /* Buttons */
  --btn-primary-bg: #37352f;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #2f2e29;
  --btn-secondary-bg: transparent;
  --btn-secondary-text: var(--text-primary);
  --btn-secondary-hover: var(--bg-hover);
  --btn-secondary-border: var(--border-primary);
  
  /* Shadows */
  --shadow-sm: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px;
  --shadow-md: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.4) 0px 9px 24px;
}

/* Custom scrollbar styles for the entire app */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-primary) var(--bg-secondary);
}

:root[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary: #191919;
  --bg-secondary: #2f3437;
  --bg-tertiary: #373c41;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --bg-selected: rgba(255, 255, 255, 0.11);
  
  /* Text colors */
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-inverse: #191919;
  
  /* Borders */
  --border-primary: rgba(255, 255, 255, 0.13);
  --border-secondary: rgba(255, 255, 255, 0.07);
  
  /* Buttons */
  --btn-primary-bg: rgba(255, 255, 255, 0.9);
  --btn-primary-text: #191919;
  --btn-primary-hover: rgba(255, 255, 255, 0.95);
  --btn-secondary-bg: transparent;
  --btn-secondary-text: var(--text-primary);
  --btn-secondary-hover: var(--bg-hover);
  --btn-secondary-border: var(--border-primary);
  
  /* Shadows */
  --shadow-sm: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px, rgba(0, 0, 0, 0.3) 0px 3px 6px, rgba(0, 0, 0, 0.4) 0px 9px 24px;
  --shadow-md: rgba(0, 0, 0, 0.3) 0px 0px 0px 1px, rgba(0, 0, 0, 0.4) 0px 3px 6px, rgba(0, 0, 0, 0.5) 0px 9px 24px;
}

* { 
  margin: 0;  
  padding: 0;  
  box-sizing: border-box;  
} 
  
body {  
  margin: 0;  
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',  
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',  
    sans-serif;  
  -webkit-font-smoothing: antialiased;  
  -moz-osx-font-smoothing: grayscale;  
  background-color: var(--bg-primary);  
  color: var(--text-primary);  
  transition: background-color 0.2s ease, color 0.2s ease;  
} 
  
.App {  
  height: 100vh;  
  display: flex;  
  flex-direction: column;  
  background-color: var(--bg-primary);  
  overflow: hidden;
} 
  
.app-header {  
  background-color: var(--bg-secondary);  
  padding: 20px;  
  border-bottom: 1px solid var(--border-primary);  
  box-shadow: var(--shadow-sm);  
} 
  
.app-header h1 {  
  color: var(--text-primary);  
  font-size: 24px;  
  font-weight: 600;  
  margin-bottom: 8px;  
}  
  
.header-content {  
  display: flex;  
  justify-content: space-between;  
  align-items: center;  
  flex-wrap: wrap;  
  gap: 16px;  
} 
  
.app-header p {  
  color: var(--text-secondary);  
  font-size: 14px;  
  margin: 0;  
}  
  
.file-input-section {  
  display: flex;  
  align-items: center;  
  gap: 12px;  
}  
  
.current-file {  
  color: #e5e5e5;  
  font-size: 13px;  
  padding: 6px 12px;  
  background-color: #404040;  
  border-radius: 6px;  
  border: 1px solid #555;  
} 
  
.file-input {  
  display: none;  
}  
  
.file-input-label {  
  background-color: #4f46e5;  
  color: white;  
  padding: 8px 16px;  
  border-radius: 6px;  
  font-size: 13px;  
  font-weight: 500;  
  cursor: pointer;  
  transition: background-color 0.2s ease;  
  border: none;  
} 
  
.file-input-label:hover {  
  background-color: var(--btn-primary-hover);  
}  
  
.file-input-label:active {  
  background-color: var(--btn-primary-hover);  
  transform: translateY(1px);
}  

/* Pagination & server toggle */
.server-toggle {  
  display: flex;  
  align-items: center;  
  gap: 6px;  
  font-size: 12px;  
  background: var(--bg-secondary);  
  padding: 6px 10px;  
  border-radius: 6px;  
  color: var(--text-primary);  
  border: 1px solid var(--border-primary);  
  transition: all 0.2s ease;
}

/* Server controls container */
.server-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Search bar styles */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  padding: 8px 12px;
  border-radius: 8px;
}

.search-input {
  flex: 1;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: none;
  outline: none;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  caret-color: var(--text-primary);
}

.search-input:focus {
  background: var(--bg-tertiary);
  outline: none;
  caret-color: var(--text-primary);
}

.search-input:focus-within {
  background: var(--bg-tertiary);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-btn, .clear-search-btn {
  background: #6366f1;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.search-btn:hover:not(:disabled) {
  background: #5855eb;
  transform: translateY(-1px);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.clear-search-btn {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}

.clear-search-btn:hover:not(:disabled) {
  background: var(--btn-secondary-hover);
  transform: translateY(-1px);
}

.pagination-bar {  
  display: flex;  
  align-items: center;  
  gap: 8px;  
  background: var(--bg-secondary);  
  border: 1px solid var(--border-primary);  
  padding: 6px 10px;  
  border-radius: 8px;  
}

.pg-btn, .pg-refresh {  
  background: var(--btn-secondary-bg);  
  color: var(--btn-secondary-text);  
  border: 1px solid var(--btn-secondary-border);  
  padding: 6px 10px;  
  font-size: 12px;  
  border-radius: 6px;  
  cursor: pointer;  
  min-width: 40px;  
  transition: all 0.15s ease;  
}
.pg-btn:disabled, .pg-refresh:disabled {  
  opacity: .4;  
  cursor: not-allowed;  
}
.pg-btn:hover:not(:disabled), .pg-refresh:hover:not(:disabled) {  
  background: var(--btn-secondary-hover);  
  border-color: var(--border-primary);  
  color: var(--text-primary);
  transform: translateY(-1px);
}
.pg-btn:active:not(:disabled), .pg-refresh:active:not(:disabled) {  
  transform: translateY(1px);  
}

.pg-select {  
  background: #1f1f1f;  
  color: #e5e5e5;  
  border: 1px solid #555;  
  padding: 5px 8px;  
  font-size: 12px;  
  border-radius: 6px;  
}
.pg-select:focus {  
  outline: none;  
  border-color: #6366f1;  
}

.pg-status {  
  font-size: 12px;  
  color: #b0b0b0;  
  min-width: 110px;  
  text-align: center;  
}

.loading-indicator, .error-indicator {  
  position: absolute;  
  top: 60px;  
  left: 20px;  
  background: #2d2d2d;  
  border: 1px solid #404040;  
  padding: 10px 14px;  
  border-radius: 8px;  
  font-size: 12px;  
  z-index: 900;  
}
.error-indicator {  
  border-color: #dc2626;  
  color: #fca5a5;  
}
  
.app-main {  
  flex: 1;  
  position: relative;  
  overflow: hidden;  
} 
  
.node-details {  
  position: absolute;  
  top: 100px;  
  right: 20px;  
  width: 300px;  
  background-color: #2d2d2d;  
  border: 1px solid #404040;  
  border-radius: 8px;  
  padding: 20px;  
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);  
  z-index: 1000;  
} 
  
.node-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #404040;
}
  
.node-details h3 {  
  color: #ffffff;  
  font-size: 16px;  
  margin: 0;
}  
  
.close-btn {
  background: none;
  border: none;
  color: #b0b0b0;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: #404040;
  color: #ffffff;
}
  
.node-details p {  
  color: #e5e5e5;  
  font-size: 13px;  
  margin-bottom: 8px;  
  line-height: 1.4;  
} 
  
.node-details strong {  
  color: #ffffff;  
  font-weight: 500;  
}  
  
.node-details ul {  
  list-style: none;  
  margin-top: 8px;  
  margin-left: 16px;  
}  
  
.node-details li {  
  color: #b0b0b0;  
  font-size: 12px;  
  margin-bottom: 4px;  
  padding-left: 12px;  
  position: relative;  
} 
  
.node-details li::before {  
  content: '';  
  color: #666;  
  position: absolute;  
  left: 0;  
}  
  
/* Drag and Drop Overlay */  
.drag-overlay {  
  position: fixed;  
  top: 0;  
  left: 0;  
  width: 100%;
  height: 100%;
  background-color: rgba(79, 70, 229, 0.9);  
  display: flex;  
  align-items: center;  
  justify-content: center;  
  z-index: 9999;  
  backdrop-filter: blur(4px);  
} 
  
.drag-message {  
  text-align: center;  
  color: white;  
  padding: 40px;  
  border: 3px dashed rgba(255, 255, 255, 0.8);  
  border-radius: 12px;  
  background-color: rgba(255, 255, 255, 0.1);  
}  
  
.drag-message h2 {  
  font-size: 32px;  
  margin-bottom: 12px;  
  font-weight: 600;  
}  
  
.drag-message p {  
  font-size: 18px;  
  opacity: 0.9;  
} 

/* Pagination indicator styles */
.pagination-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 16px;
}
