/* Reading Mate - Modern CSS with Dark Mode Support */

/* Password Protection Styles */
.password-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.password-modal {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  max-width: 400px;
  width: 90%;
  text-align: center;
}

[data-theme="dark"] .password-modal {
  background: #2d2d2d;
  color: white;
}

.password-header h2 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1.5rem;
}

[data-theme="dark"] .password-header h2 {
  color: white;
}

.password-header p {
  margin: 0 0 2rem 0;
  color: #666;
  font-size: 0.9rem;
}

[data-theme="dark"] .password-header p {
  color: #b0b0b0;
}

.password-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
}

.password-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.password-form .btn-primary {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.password-hint {
  font-size: 0.8rem;
  color: #999;
  margin: 0;
}

.context-section {
  background: var(--bg-primary);
  border-radius: 8px;
  margin: 0.5rem;
  border: 1px solid var(--border-light);
}

.context-input {
  padding: 0.5rem 0;
}

.context-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.context-field {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg-secondary);
}

.quick-actions {
  text-align: center;
}

.api-status {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

:root {
  /* Light theme colors */
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #868e96;
  
  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
  
  --transition: all 0.2s ease;
  --border-radius: 8px;
  --border-radius-sm: 4px;
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #404040;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  
  --border-color: #404040;
  --border-light: #505050;
  --shadow: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.4);
}

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition);
}

/* App container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-controls {
  display: flex;
  gap: 0.5rem;
}

/* AR Mode Controls */
.ar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: 1rem;
  padding-right: 1rem;
  border-right: 1px solid var(--border-color);
}

.ar-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ar-toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 40px;
  height: 20px;
  background: var(--border-color);
  border-radius: 10px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.ar-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: var(--primary-color);
}

.ar-toggle input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.ar-device-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  min-width: 150px;
}

.ar-device-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* AR Mode Status */
.ar-status {
  display: none;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1rem;
}

.ar-status.active {
  display: block;
}

.ar-status .status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Responsive design for AR controls */
@media (max-width: 768px) {
  .ar-controls {
    margin-right: 0.5rem;
    padding-right: 0.5rem;
    gap: 0.5rem;
  }
  
  .toggle-label {
    display: none;
  }
  
  .ar-device-select {
    min-width: 120px;
    font-size: 0.8rem;
  }
}


/* Voice Controls */
.voice-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.voice-btn {
    flex: 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.voice-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.voice-btn:active {
    transform: translateY(0);
}

.voice-btn .icon {
    font-size: 16px;
}

/* Voice Indicator (ElevenLabs) */
.voice-indicator {
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.voice-indicator.idle {
    background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
    color: #1976d2;
    border-color: #e3f2fd;
}

.voice-indicator.speaking {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    animation: speak 1s infinite;
    border-color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

.voice-indicator.loading {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-color: #ff9800;
    animation: thinking 2s infinite;
}

.voice-indicator.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border-color: #f44336;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes thinking {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes speak {
    0%, 100% { border-width: 2px; }
    50% { border-width: 4px; }
}

/* Main content layout */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.reading-pane {
  flex: 2.5;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

.control-panel {
  flex: 1;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Reading pane styles */
.document-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.document-header h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 500;
}

.document-controls {
  display: flex;
  gap: 0.5rem;
}

.document-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 300px;
  border: 2px dashed transparent;
  transition: var(--transition);
  position: relative;
}

.document-content:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--bg-secondary);
}

.document-content:focus::before {
  content: "✏️ Editing mode - Type or paste your content here";
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary-color);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  z-index: 10;
  animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

.document-content:empty::before {
  content: "Click here to start typing, or use the buttons above to load/paste content";
  color: var(--text-muted);
  font-style: italic;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.document-content h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.document-content p {
  margin-bottom: 1.25rem;
  text-align: justify;
}

.document-content p:last-child {
  margin-bottom: 0;
}

/* Content placeholder styles */
.content-placeholder {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 2px dashed var(--border-color);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.content-placeholder h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.content-placeholder ul {
  text-align: left;
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.content-placeholder li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.content-placeholder li strong {
  color: var(--primary-color);
}

.sample-content {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  text-align: left;
}

.sample-content h4 {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.sample-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Document controls styling */
.document-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.document-controls .btn-secondary {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

.document-controls .icon {
  font-size: 0.9rem;
}

/* Responsive document controls */
@media (max-width: 768px) {
  .document-controls {
    justify-content: center;
    width: 100%;
  }
  
  .document-controls .btn-secondary {
    flex: 1;
    min-width: 80px;
  }
  
  .content-placeholder {
    margin: 1rem;
    padding: 1.5rem;
  }
}

/* Text selection highlighting */
::selection {
  background-color: rgba(0, 123, 255, 0.2);
  color: var(--text-primary);
}

/* Control panel styles - cleaner, less cluttered */
.panel-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.panel-section:last-child {
  border-bottom: none;
}

.panel-section h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Compact sections */
.compact-section {
  padding: 0.75rem 1rem;
}

.action-section {
  padding: 1.25rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  margin: 0.5rem;
  border: none;
}

.stats-section {
  padding: 0.5rem 1rem;
  background: transparent;
}

/* Intelligent controls - natural language interface */
.intelligent-controls {
  font-size: 0.9rem;
  line-height: 1.6;
}

.control-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.control-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  margin: 0;
}

.smart-select {
  border: none;
  background: var(--bg-primary);
  color: var(--primary-color);
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: var(--transition);
  min-width: 120px;
}

.smart-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.custom-field-input {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Large primary button */
.large-btn {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
}

.large-btn .icon {
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

/* Action grid for compact buttons */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.compact-btn {
  padding: 0.625rem;
  border-radius: 6px;
  font-size: 0.85rem;
  min-width: unset;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compact-btn .icon {
  font-size: 1rem;
  margin: 0;
}

/* Minimal voice indicator */
.voice-indicator.minimal {
  text-align: center;
  padding: 0.5rem;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.voice-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mini stats */
.mini-stats {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
}

.mini-stat {
  text-align: center;
  flex: 1;
}

.mini-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.mini-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.25rem;
}

/* Clean annotation output */
.annotation-output.clean {
  border: none;
  background: transparent;
  padding: 0;
}

.empty-state.minimal {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.empty-text {
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .control-group {
    width: 100%;
  }
  
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .mini-stats {
    gap: 0.5rem;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Form elements */
select, input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

input[type="range"] {
  width: 100%;
  margin: 0.5rem 0;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-text, .icon-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

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

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

.btn-secondary:hover {
  background-color: var(--border-light);
}

.btn-text {
  background: none;
  color: var(--primary-color);
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.btn-text:hover {
  background-color: rgba(0, 123, 255, 0.1);
}

.icon-btn {
  padding: 0.5rem;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.icon-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Icons */
.icon {
  font-size: 1em;
  line-height: 1;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 0.75rem;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-light);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Annotation section */
.annotation-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.annotation-output {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  margin-top: 0.5rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.empty-state .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.shortcut-hint {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Annotation items */
.annotation-item {
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.annotation-item:last-child {
  margin-bottom: 0;
}

.annotation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.annotation-field {
  background-color: var(--primary-color);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.annotation-time {
  color: var(--text-muted);
}

.annotation-text {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-style: italic;
}

.annotation-result {
  color: var(--text-primary);
  line-height: 1.5;
}

/* Loading states */
.loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem;
}

.loading::before {
  content: "⏳";
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status bar */
.status-bar {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-text {
  color: var(--text-muted);
}

.version {
  color: var(--text-muted);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
}

/* Help modal specific styles */
.help-section {
  margin-bottom: 1.5rem;
}

.help-section:last-child {
  margin-bottom: 0;
}

.shortcut-list {
  list-style: none;
  margin: 0.5rem 0;
}

.shortcut-list li {
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

kbd {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Settings modal specific styles */
.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.api-key-container {
  display: flex;
  gap: 0.5rem;
}

.api-key-container input {
  flex: 1;
}

.btn-icon {
  padding: 0.5rem;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.setting-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.setting-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--danger-color);
}

.toast.warning {
  border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  
  .reading-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .document-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    gap: 0.5rem;
  }
  
  .app-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .document-content {
    padding: 1rem;
  }
  
  .panel-section {
    padding: 0.75rem;
  }
  
  .modal-content {
    width: 95%;
  }
}

/* Print styles */
@media print {
  .control-panel,
  .app-header,
  .status-bar {
    display: none;
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .reading-pane {
    border: none;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
button:focus,
select:focus,
input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-primary: #000000;
    --bg-primary: #ffffff;
  }
  
  [data-theme="dark"] {
    --border-color: #ffffff;
    --text-primary: #ffffff;
    --bg-primary: #000000;
  }
}

/* Toast Notifications Enhanced */
.toast {
    position: relative;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
}

/* Proactive Suggestions */
.proactive-suggestion {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9ff 100%);
    border: 1px solid #4caf50;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 0;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.suggestion-content {
    padding: 16px;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.suggestion-icon {
    font-size: 18px;
}

.suggestion-title {
    font-weight: 600;
    color: #2e7d32;
}

.suggestion-text {
    color: #1b5e20;
    line-height: 1.4;
    margin-bottom: 12px;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
}

.accept-suggestion {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.accept-suggestion:hover {
    background: #45a049;
}

.dismiss-suggestion {
    background: transparent;
    color: #666;
    border-color: #ccc;
}

.dismiss-suggestion:hover {
    background: #f5f5f5;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
