/* =========================================
   HEADER & BANNER
   ========================================= */
#banner {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

/* =========================================
   NAVIGATION (Desktop & Mobile)
   ========================================= */

/* --- Desktop Styles (Default) --- */
nav.tabs ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  text-align: center;
  display: block; /* Ensures visibility on desktop */
}

nav.tabs li {
  display: inline-block;
  margin: 0 5px;
}

nav.tabs a {
  display: block;
  padding: 12px 20px;
  background-color: var(--white);
  color: var(--text-color);
  font-weight: bold;
  border-radius: 6px 6px 0 0;
  transition: background-color 0.3s, color 0.3s;
}

nav.tabs a:hover {
  background-color: var(--pastel-blue-dark);
  color: var(--white);
  text-decoration: none;
}

/* Hidden by default (only for mobile) */
#navicon {
  display: none; 
}

/* --- Mobile Navigation (Tutorial 5) --- */
@media only screen and (max-width: 768px) {
  
  /* Show the hamburger icon */
  #navicon {
    display: block;
    font-size: 30px;
    padding: 10px 20px;
    text-align: right;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
  }

  /* Hide the list of links by default */
  nav.tabs ul {
    display: none; /* JavaScript will toggle this */
    flex-direction: column;
  }
  
  /* This class is added by JavaScript to show the menu */
  nav.tabs ul.open {
    display: flex;
  }

  /* Stack links vertically */
  nav.tabs li {
    display: block;
    margin: 0;
    border-bottom: 1px solid #ddd;
  }

  nav.tabs a {
    border-radius: 0; 
  }
}

/* =========================================
   MAIN PAGE LAYOUT
   ========================================= */
section {
  max-width: 900px;
  margin: 30px auto;
  padding: 25px;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: auto; /* Contains floated elements */
}

/* Floated image inside main section (e.g., About Me photo) */
section img#about-me-pic, 
section img.float-right {
  float: right;
  width: 300px;
  margin-left: 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 4px solid var(--pastel-purple);
}

section h1 {
  margin-top: 0;
}

/* =========================================
  POSTER LISTS (Rankings/Favorites)
   ========================================= */
.poster-list {
  list-style-type: none;
  padding-left: 0;
}

.poster-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
}

.poster-list img {
  width: 100px;
  height: auto;
  margin-right: 15px;
  border-radius: 4px;
  border: 3px solid var(--pastel-purple);
  flex-shrink: 0;
}

.poster-list div {
  flex-grow: 1;
}

.poster-list .title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 5px;
  color: var(--text-color);
}

.poster-list .description {
  font-size: 1rem;
  margin: 0;
}

/* =========================================
  TABLES 
   ========================================= */
/* Desktop Table */
table.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 1rem;
}

table.ranking-table th, 
table.ranking-table td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

table.ranking-table th {
  background-color: var(--pastel-purple);
  color: var(--text-color);
  font-weight: bold;
}

/* Mobile Table (Card View) */
@media only screen and (max-width: 600px) {
  table.ranking-table, table.ranking-table thead, table.ranking-table tbody, 
  table.ranking-table th, table.ranking-table td, table.ranking-table tr { 
    display: block; 
  }

  /* Hide header row */
  table.ranking-table thead tr { 
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  table.ranking-table tr { 
    border: 1px solid #ccc; 
    margin-bottom: 15px; 
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  table.ranking-table td { 
    border: none;
    border-bottom: 1px solid #eee; 
    position: relative;
    padding-left: 50%; 
  }

  table.ranking-table td:before { 
    position: absolute;
    top: 12px;
    left: 10px;
    width: 45%; 
    padding-right: 10px; 
    white-space: nowrap;
    font-weight: bold;
    content: attr(data-label);
  }
}

/* =========================================
   FORMS
   ========================================= */
form {
  max-width: 100%;
  margin-top: 20px;
}

input[type=text], 
input[type=email], 
select, 
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 6px;
  margin-bottom: 16px;
  resize: vertical;
}

input[type=submit], 
input[type=reset] {
  background-color: var(--pastel-blue-dark);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin-right: 10px;
}

input[type=submit]:hover,
input[type=reset]:hover {
  opacity: 0.9;
}

/* =========================================
   7. MEDIA: VIDEO & AUDIO (Tutorial 8)
   ========================================= */
/* Specific style for YouTube iframes */
.responsive_video {
  aspect-ratio: 16/9;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 3px solid var(--pastel-purple);
}

/* Generic style for your own <video> and <audio> tags */
video, audio {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
}