/* 
  1) Base (Light Mode) 
  2) Dark Mode Overrides 
  3) General Styling 
*/

/* ========================= */
/* 1) BASE (LIGHT MODE)      */
/* ========================= */
:root {
    /* Light mode colors */
    --bg-color: #f9fafb;       
    --text-color: #111827;    
  

    --header-bg: linear-gradient(90deg, #6366f1, #4338ca);
    --header-text-color: #ffffff;
  
    --accent-color: #6366f1;
    --border-color: #e5e7eb;   
  }
  
  /* ========================= */
  /* 2) DARK MODE OVERRIDES    */
  /* ========================= */
  body.dark-mode {
    --bg-color: #1f2937;     
    --text-color: #f9fafb;    
  
    --header-bg: #4338ca;      
    --header-text-color: #f9fafb;
  
    /* Keep the same accent color for consistency */
    --accent-color: #6366f1;
    --border-color: #374151;   
  }
  
  /* ========================= */
  /* 3) GENERAL STYLING        */
  /* ========================= */
  
  /* RESET / GLOBAL */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
  }
  
  /* HEADER / NAV */
  .app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--header-bg);
    color: var(--header-text-color);
  }
  
  .nav-brand h1 a {
    color: var(--header-text-color);
    text-decoration: none;
  }
  
  .nav-brand h1 a:hover {
    text-decoration: underline;
  }
  
  .nav-actions a {
    color: var(--header-text-color);
    text-decoration: none;
    margin-left: 1rem;
    transition: color 0.2s, text-decoration 0.2s;
  }
  
  .nav-actions a:hover {
    text-decoration: underline;
  }
  
  .nav-actions button {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: var(--header-text-color);
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 1rem;
  }
  
  .nav-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  /* HERO SECTION */
  .hero-section {
    background-color: var(--bg-color);
    text-align: center;
    padding: 3rem 2rem;
  }
  
  .hero-text {
    max-width: 600px;
    margin: 0 auto;
  }
  
  .hero-text h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  
  .hero-text p {
    font-size: 1.1rem;
    color: #4b5563;
  }
  body.dark-mode .hero-text p {
    color: #d1d5db;
  }
  
  /* MAIN & TWO-COLUMN LAYOUT */
  .main-content {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
  }
  
  /* Content Section (for About page) */
  .content-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
  }
  
  .content-section h2 {
    text-align: center;
  }
  
  .content-section p {
    text-align: left;
  }
  
  /* Sidebar for Filters */
  .filters {
    flex: 0 0 250px;
  }
  
  /* Directory + Pagination Wrapper */
  .directory-wrapper {
    flex: 1;
  }
  
  /* Directory Grid */
  #directory {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
  }
  
  /* Search Field Styling */
  #searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
  }
  
  #searchInput::placeholder {
    color: #888;
  }
  
  #searchInput:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    outline: none;
  }
  
  /* Filter Sections */
  .filter-section {
    background-color: var(--bg-color);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1rem;
  }
  
  .filter-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
  }
  
  .filter-section label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  /* Custom Checkbox Styling */
  .filter-section input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    margin-right: 0.5rem;
  }
  
  .filter-section input[type="checkbox"]:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
  }
  
  .filter-section input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  
  .filter-section input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 3px var(--accent-color);
  }
  
  /* App Card Styling */
  .app-card {
    position: relative;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s;
  }
  
  .app-card:hover {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  }
  
  .app-logo {
    max-width: 60px;
    height: auto;
    margin-bottom: 1rem;
  }
  
  .app-card h2 {
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
    color: var(--accent-color);
  }
  
  .app-card p {
    margin-bottom: 0.5rem;
  }
  
  .app-card a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
  }
  
  .app-card a:hover {
    text-decoration: underline;
  }
  
  /* Featured Badge & Card Styling */
  .featured-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #fde047;
    color: #1f2937;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  }
  
  body:not(.dark-mode) .featured-card {
    border: 2px solid #fcd34d;
    box-shadow: 0 4px 18px rgba(253, 211, 82, 0.25);
    position: relative;
    transition: box-shadow 0.3s, transform 0.3s;
  }
  
  body.dark-mode .featured-card {
    border: 2px solid #fde047;
    box-shadow: 0 4px 18px rgba(253, 224, 71, 0.4);
    position: relative;
    transition: box-shadow 0.3s, transform 0.3s;
  }
  
  .featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 224, 71, 0.6);
  }
  
  /* Pagination Controls */
  #pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
  }
  
  #pagination button {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  #pagination button:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: #fff;
  }
  
  #pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  #pagination button.active {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: bold;
  }
  
  /* Mobile Responsiveness */
  @media (max-width: 768px) {
    .main-content {
      flex-direction: column;
    }
    
    .filters {
      flex: none;
      width: 100%;
      margin-bottom: 1rem;
    }
    
    .directory-wrapper {
      width: 100%;
    }
  }
  
  .app-footer {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 1rem;
  }

  .buy-me-a-coffee {
    text-align: center;
    margin-top: 1rem;
  }
  
  .buy-me-a-coffee img {
    max-height: 50px; /* Adjust the size as needed */
    width: auto;
  }
  