/* CSS Variables for theming */
:root {
  --primary-color: #dd9406;
  --primary-dark: #b8730c;
  --primary-light: #f2a624;
  --background: #ffffff;
  --surface: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border: #dee2e6;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  --background: #1a1a1a;
  --surface: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #adb5bd;
  --border: #404040;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


.bg.fs {
  .container {
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 5rem;
  }

  /* Header */
  .header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow);
  }

  .title {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
  }

  .theme-toggle {
    display: flex;
    align-items: center;
  }

  .theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
  }

  .theme-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
  }

  /* Toolbar */
  .toolbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
  }

  .toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: fit-content;
  }

  .btn-icon {
    font-size: 0.875rem;
  }

  .btn-primary {
    background: var(--primary-color);
    color: white;
  }

  .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-hover);
  }

  .btn-secondary {
    background: var(--text-secondary);
    color: white;
  }

  .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
  }

  .btn-success {
    background: var(--success);
    color: white;
  }

  .btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
  }

  .btn-info {
    background: var(--info);
    color: white;
  }

  .btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
  }

  .btn-warning {
    background: var(--warning);
    color: #212529;
  }

  .btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
  }

  .btn-danger {
    background: var(--danger);
    color: white;
  }

  .btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
  }

  .btn-upload {
    background: var(--primary-light);
    color: white;
  }

  .btn-upload:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
  }

  .btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
  }

  .btn-ghost:hover {
    background: var(--surface);
    border-color: var(--primary-color);
  }

  .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  /* View Toggle */
  .view-toggle {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
  }

  .view-btn {
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
  }

  .view-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
  }

  .view-btn:hover {
    color: var(--primary-color);
  }

  /* Search Bar */
  .search-bar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
  }

  .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
  }

  .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(221, 148, 6, 0.1);
  }

  /* Editor Container */
  .editor-container {
    
    position: relative;
    overflow: hidden;
  }

  .view {
    display: none;
    height: 100%;
  }

  .view.active {
    display: block;
  }

  .editor-wrapper {
    position: relative;
    height: 100%;
    display: flex;
  }

  .line-numbers {
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 1rem 0.5rem;
    text-align: right;
    user-select: none;
    min-width: 50px;
  }

  .json-editor {
    flex: 1;
    border: none;
    outline: none;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: var(--background);
    color: var(--text-primary);
    resize: none;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
  }

  .json-editor:focus {
    background: var(--background);
  }

  /* JSON Tree View */
  .json-tree {
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow: auto;
    height: 100%;
  }

  .tree-item {
    margin: 2px 0;
  }

  .tree-key {
    color: var(--primary-color);
    font-weight: 600;
  }

  .tree-string {
    color: var(--success);
  }

  .tree-number {
    color: #0066cc;
  }

  .tree-boolean {
    color: var(--danger);
  }

  .tree-null {
    color: var(--text-secondary);
    font-style: italic;
  }

  .tree-bracket {
    color: var(--text-secondary);
    font-weight: bold;
  }

  .tree-expand {
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    margin-right: 5px;
  }

  .tree-expand:hover {
    color: var(--primary-color);
  }

  .tree-collapsed .tree-children {
    display: none;
  }

  .tree-children {
    margin-left: 20px;
  }

  /* Status Bar */
  .status-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
  }

  .status-right {
    display: flex;
    gap: 1rem;
  }

  /* Drop Zone */
  .drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(221, 148, 6, 0.1);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }

  .drop-content {
    background: var(--background);
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    border: 2px dashed var(--primary-color);
    box-shadow: 0 8px 32px var(--shadow);
  }

  .drop-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
  }

  .drop-content p {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
  }

  /* Notification */
  .notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 1000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    color: var(--text-primary);
  }

  .notification.show {
    transform: translateX(0);
  }

  .notification.success {
    border-left: 4px solid var(--success);
  }

  .notification.error {
    border-left: 4px solid var(--danger);
  }

  .notification.warning {
    border-left: 4px solid var(--warning);
  }

  .notification.info {
    border-left: 4px solid var(--info);
  }

  /* Utility Classes */
  .hidden {
    display: none;
  }

  /* Error highlighting */
  .json-editor.error {
    border-left: 4px solid var(--danger);
  }

  .error-line {
    background: rgba(220, 53, 69, 0.1);
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    .header {
      padding: 1rem;
    }

    .title {
      font-size: 1.5rem;
    }

    .toolbar {
      padding: 1rem;
      justify-content: center;
    }

    .toolbar-group {
      flex-wrap: wrap;
    }

    .btn {
      padding: 0.4rem 0.8rem;
      font-size: 0.8rem;
    }

    .search-bar {
      padding: 1rem;
      flex-direction: column;
      align-items: stretch;
    }

    .search-input {
      margin-bottom: 0.5rem;
      min-width: auto;
    }

    .view-toggle {
      padding: 0 1rem;
    }

    .status-bar {
      padding: 0.5rem 1rem;
      flex-direction: column;
      gap: 0.25rem;
      text-align: center;
    }

    .status-right {
      justify-content: center;
    }

    .notification {
      right: 1rem;
      left: 1rem;
      top: 1rem;
    }

    .json-editor {
      font-size: 12px;
    }

    .line-numbers {
      font-size: 12px;
    }

    .json-tree {
      font-size: 12px;
    }
  }

  @media (max-width: 480px) {
    .toolbar {
      gap: 0.5rem;
    }

    .btn {
      padding: 0.3rem 0.6rem;
      font-size: 0.75rem;
    }

    .btn-icon {
      font-size: 0.75rem;
    }

    .search-bar {
      gap: 0.25rem;
    }

    .drop-content {
      padding: 2rem;
    }

    .drop-icon {
      font-size: 2rem;
    }

    .drop-content p {
      font-size: 1rem;
    }
  }

  /* Print styles */
  @media print {

    .header,
    .toolbar,
    .view-toggle,
    .search-bar,
    .status-bar {
      display: none;
    }

    .editor-container {
      height: auto;
    }

    .json-editor {
      height: auto;
      min-height: 500px;
    }
  }

  /* High contrast mode */
  @media (prefers-contrast: high) {
    :root {
      --shadow: rgba(0, 0, 0, 0.3);
      --shadow-hover: rgba(0, 0, 0, 0.5);
      --border: #000000;
    }

    [data-theme="dark"] {
      --border: #ffffff;
    }
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    * {
      transition: none !important;
      animation: none !important;
    }
  }
}