/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  /* Theme Variables */
  :root {
    --bg: #f5f7fa;
    --text: #333;
    --card-bg: white;
    --card-border: #ddd;
    --link: #2c3e50;
    --link-hover: #007bff;
    --desc: #666;
  }
  
  body.dark {
    --bg: #121212;
    --text: #eee;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --link: #aad3ff;
    --link-hover: #78b9ff;
    --desc: #aaa;
  }
  
  /* Base Styles */
  body {
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 2rem;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
  }
  
  header {
    display: flex;
    justify-content: space-between;
  }
  
  /* Dark mode fallback for users who prefer dark scheme */
  @media (prefers-color-scheme: dark) {
    body:not(.dark):not(.light) {
      background: #121212;
      color: #eee;
    }
  
    body:not(.dark):not(.light) .category-card {
      background: #1e1e1e;
      border: 1px solid #333;
    }
  
    body:not(.dark):not(.light) a {
      color: #aad3ff;
    }
  }
  
  /* Toggle Button */
  #theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
    z-index: 1000;
  }
  
  /* Grid Layout */
  #bookmark-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  /* Card Styling */
  .category-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1rem;
    transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease;
  }
  
  .category-card:hover {
    transform: translateY(-4px);
  }
  
  .category-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
  }
  
  /* Bookmark List */
  .bookmark-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 0;
    margin: 0;
  }
  
  .bookmark-list li {
    display: flex;
    flex-direction: column;
  }
  
  .bookmark-list a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--link);
    transition: color 0.2s ease;
  }
  
  .bookmark-list a:hover {
    color: var(--link-hover);
  }
  
  .favicon {
    width: 16px;
    height: 16px;
  }
  
  /* Description under links */
  .desc {
    font-size: 0.75rem;
    color: var(--desc);
    margin-top: 0.2rem;
  }
  

  #quote-box {
    justify-self: right;
    margin-bottom: 1rem;
    max-width: 50%;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    padding: 1rem;
    border-radius: 8px;
    font-style: italic;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }
  
  body.dark #quote-box {
    background: rgba(30, 30, 30, 0.85);
    color: #eee;
  }