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

html {
  background-color: #1a1a1a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

/* Layout utilities */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }

/* Typography */
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-bold { font-weight: 700; }
.mb-8 { margin-bottom: 2rem; }

/* Colors */
.bg-dark-bg { background-color: #1a1a1a; }
.text-dark-text { color: #e0e0e0; }
.text-dark-muted { color: #9ca3af; }

/* Components */
.btn-primary {
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.sidebar {
  background-color: #2a2a2a;
  border-right: 1px solid #404040;
  width: 256px;
  height: 100vh;
  overflow-y: auto;
}

.newsletter-item {
  padding: 1rem;
  border-bottom: 1px solid #404040;
  cursor: pointer;
  transition: background-color 0.2s;
}

.newsletter-item:hover {
  background-color: #2a2a2a;
}

.newsletter-item.unread {
  background-color: rgba(59, 130, 246, 0.1);
}

.newsletter-content {
  max-width: none;
  color: #e0e0e0;
}

.newsletter-content h1, .newsletter-content h2, .newsletter-content h3 {
  color: #f3f4f6;
  margin: 1rem 0 0.5rem 0;
}

.newsletter-content p {
  margin: 0.5rem 0;
}

.newsletter-content a {
  color: #60a5fa;
  text-decoration: underline;
}

.newsletter-content a:hover {
  color: #93c5fd;
}

/* Mobile-responsive styles */
/* Hamburger menu button - hidden on desktop */
.mobile-header {
  display: none;
  background-color: #2a2a2a;
  border-bottom: 1px solid #404040;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  align-items: center;
  justify-content: space-between;
}

.hamburger-btn {
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

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

.mobile-header-title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
  text-align: center;
  margin-right: 44px; /* Balance the hamburger button */
}

/* Sidebar overlay backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar-backdrop.active {
  display: block;
}

/* Mobile responsive layout */
@media (max-width: 640px) {
  /* Show mobile header with hamburger */
  .mobile-header {
    display: flex;
  }

  /* Hide sidebar by default, show as overlay when active */
  .sidebar {
    position: fixed;
    top: 0;
    left: -256px; /* Hidden by default */
    width: 256px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .sidebar.active {
    left: 0; /* Slide in when active */
  }

  /* Main content takes full width on mobile */
  #list-view {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Mobile-optimized newsletter items */
  .newsletter-item {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-height: 44px; /* Minimum touch target */
  }

  .newsletter-item:hover {
    background-color: #333333;
  }

  .newsletter-item.unread {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
  }

  /* Hide secondary details on mobile */
  .newsletter-meta-mobile {
    display: none;
  }

  /* Larger title for mobile readability */
  .newsletter-title-mobile {
    font-size: 1rem;
    line-height: 1.4;
  }

  /* Larger sender name */
  .newsletter-from-mobile {
    font-size: 0.9rem;
    margin-top: 0.25rem;
  }
}

/* Tablet portrait mode - hide sidebar like mobile */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  /* Show mobile header with hamburger */
  .mobile-header {
    display: flex;
  }

  /* Hide sidebar by default, show as overlay when active */
  .sidebar {
    position: fixed;
    top: 0;
    left: -256px; /* Hidden by default */
    width: 256px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }

  .sidebar.active {
    left: 0; /* Slide in when active */
  }

  /* Main content takes full width */
  #list-view {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Card-style newsletter items for tablet portrait */
  .newsletter-item {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 0.75rem;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-height: 44px;
  }

  .newsletter-item:hover {
    background-color: #333333;
  }

  .newsletter-item.unread {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
  }
}

/* Tablet landscape mode - show sidebar like desktop (no special styles needed) */
/* Desktop (>1024px) - show sidebar like normal (no special styles needed) */