:root {
  --primary: #f1c40f;
  --bg-dark: #111;
  --bg-light: #222;
  --text: #fff;
  --border: #333;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text);
}

/* Header and Logo */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-light);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

header img {
  height: 40px;
  margin-right: 15px;
}

header h1 {
  color: var(--primary);
  font-size: 1.5rem;
  margin: 0;
}

/* Navigation */
nav {
  background-color: #000;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav li {
  display: inline-block;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); /* add shadow */
  transition: background-color 0.3s, color 0.3s;
}

nav a:hover,
nav a.active {
  background-color: var(--primary);
  color: #000;
}

/* Footer */
footer {
  text-align: center;
  padding: 15px;
  background-color: var(--bg-light);
  font-size: 0.9rem;
  color: #888;
  border-top: 1px solid var(--border);
}

/* Communication Templates */
main {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background-color: var(--bg-light);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

h2 {
  color: var(--primary);
  margin-bottom: 10px;
}

label {
  font-weight: bold;
  margin-top: 10px;
  display: block;
  color: var(--primary);
}

select, textarea, input {
  width: 100%;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 1em;
  background-color: var(--bg-dark);
  color: var(--text);
}

button {
  background-color: var(--primary);
  color: #000;
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #e1b500;
}

.template-container {
  margin-top: 20px;
}

.template {
  background-color: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
}

.template h3 {
  margin: 0;
  color: var(--primary);
}

.template p {
  margin: 5px 0;
  color: #ccc;
}

/* ===============================
   RESPONSIVE DESIGN - MOBILE FIRST
   =============================== */

/* Mobile Breakpoints */
@media (max-width: 768px) {
  /* Header adjustments */
  header {
    flex-direction: column;
    padding: 15px 10px;
    text-align: center;
  }
  
  header img {
    height: 35px;
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  header h1 {
    font-size: 1.3rem;
  }
  
  /* Navigation mobile-friendly */
  nav {
    padding: 10px;
  }
  
  nav ul {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  nav li {
    width: 100%;
    max-width: 200px;
  }
  
  nav a {
    display: block;
    text-align: center;
    padding: 10px 15px;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Main content adjustments */
  main {
    max-width: 100%;
    margin: 10px;
    padding: 15px;
  }
  
  /* Form elements full width */
  select, textarea, input {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Button adjustments */
  button {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  /* Template container */
  .template-container {
    margin-top: 15px;
  }
  
  .template {
    padding: 15px;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  header h1 {
    font-size: 1.1rem;
  }
  
  main {
    margin: 5px;
    padding: 10px;
  }
  
  button {
    padding: 15px 20px;
  }
}

/* Tablet breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
  main {
    max-width: 95%;
    padding: 20px 15px;
  }
  
  nav ul {
    gap: 15px;
  }
}

/* Dashboard specific responsive styles */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-box {
    padding: 1rem;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .filter-tabs {
    overflow-x: auto;
    padding-bottom: 5px;
    flex-wrap: nowrap;
  }
  
  .tab-btn {
    white-space: nowrap;
    min-width: 120px;
  }
}

/* Events grid responsive */
@media (max-width: 768px) {
  .events-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .event-card {
    padding: 1rem;
  }
  
  .event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .attendance-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .attendance-stat {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Event details responsive */
@media (max-width: 768px) {
  .event-meta {
    grid-template-columns: 1fr;
  }
  
  .attendance-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .attendee-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .attendee-list {
    max-height: 300px;
  }
}

/* Modal responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 5% auto;
    padding: 15px;
  }
  
  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .modal-body {
    max-height: 60vh;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-footer button {
    width: 100%;
  }
}

/* Table responsive */
@media (max-width: 768px) {
  table {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 0.5rem 0.25rem;
  }
  
  /* Stack table cells vertically on very small screens */
  @media (max-width: 480px) {
    table, thead, tbody, th, td, tr {
      display: block;
    }
    
    thead tr {
      position: absolute;
      top: -9999px;
      left: -9999px;
    }
    
    tr {
      border: 1px solid var(--border);
      margin-bottom: 10px;
      padding: 10px;
      border-radius: 5px;
    }
    
    td {
      border: none;
      position: relative;
      padding-left: 50%;
      text-align: left;
    }
    
    td:before {
      content: attr(data-label) ": ";
      position: absolute;
      left: 6px;
      width: 45%;
      text-align: left;
      font-weight: bold;
      color: var(--primary);
    }
  }
}

/* Utility classes for responsive design */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
  
  .show-mobile {
    display: block;
  }
}

/* Responsive text sizes */
@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .text-large {
    font-size: 1rem;
  }
  
  .text-small {
    font-size: 0.8rem;
  }
}

/* Touch-friendly interactive elements */
@media (hover: none) and (pointer: coarse) {
  button, .btn, nav a, .tab-btn, .event-card {
    min-height: 44px;
    min-width: 44px;
  }
  
  .attendee-item {
    min-height: 44px;
  }
}
