/* Global Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Full-screen gradient background with centered container */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #F8F5EB;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 2rem;
  transition: filter 0.3s ease;
}

/* Top-notch link */
.top-notch {
  position: absolute;
  top: 0px;
  width: 100%;
  text-align: center;
  z-index: 10;
}

#premisubs-link {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 100;
  color: black;
  text-decoration: none;
  transition: color 0.3s;
}

#premisubs-link:hover {
  color: black;
}

/* Menu toggle button */
.menu-toggle {
  position: fixed;
  top: 20px;
  left: 40px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around; /* Adjusts space between bars */
  width: 30px;
  height: 20px;
}

.bar {
  width: 30px;
  height: 2px;
  background-color: black;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.close-text {
  font-family: 'Helvetica', sans-serif;
  font-size: 14px;
  color: black;
  display: none;
  margin-top: -15px;
  margin-left: 60px;  /* Adjusted the margin to move it more to the right */
  transition: opacity 0.3s ease;
}

.menu-toggle.open .bar-top {
  transform: rotate(45deg) translateY(7px);
}

.menu-toggle.open .bar-bottom {
  transform: rotate(-45deg) translateY(-7px);
}

.menu-toggle.open .bar {
  opacity: 1;
}

.menu-toggle.open .bar-middle {
  opacity: 0;
}

/* This ensures the transition from hamburger to X is smooth */
.menu-toggle .bar-middle {
  width: 30px;
  height: 3px;
  background-color: black;
  transition: opacity 0.3s ease;
}

.menu-toggle.open #close-text {
  display: inline-block;
  opacity: 1;
  transform: translateX(0);
}

/* Floating menu window */
.menu-window {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100%;
  background: #fff;
  color: black;
  transition: left 0.3s ease-in-out;
  z-index: 99;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
}

.menu-window ul {
  list-style: none;
  padding: 60px 20px 20px 20px;
}

.menu-window ul li {
  margin: 20px 0;
  position: relative;
  transition: opacity 0.3s ease;
}

.menu-window ul li:not(:hover) {
  opacity: 0.5;
}

.menu-item {
  font-family: 'Helvetica', sans-serif;
  color: black;
  font-size: 1.2rem;
  text-decoration: none;
  font-weight: 200;
  position: relative;
}

.menu-item:hover {
  color: black;
}

.menu-item::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: black;
  transition: width 0.3s ease-in-out;
}

.menu-item:hover::after {
  width: 100%;
}

/* Main content wrapper */
.content-wrapper {
  width: 100%;
  transition: filter 0.3s ease;
}

body.menu-open .content-wrapper {
  filter: blur(5px);
}

.content-wrapper * {
  pointer-events: auto;
}

/* Card container styling with responsive grid layout */
.card-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: -2.5rem !important; /* Move the card container up */
  max-width: 89%;
  margin: 0 auto;
}

/* Individual card styling */
.card {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  max-width: 350px;
  margin: 0 auto;
  width: 312px;
  height: 275px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card p {
  font-size: 1.1rem;
  color: #555;
}

.footer {
  text-align: center;
  padding: 10px 0;
  font-family: 'Helvetica', sans-serif;
  font-weight: 100;
  font-size: 14px;
  color: black;
  position: static !important;
  bottom: auto !important;
  width: 100%;
  margin-top: auto;
}

/* Media query for small screens */
@media (max-width: 768px) {
  .card-container {
    grid-template-columns: 1fr;
  }
  body {
    padding-top: 1.5rem;
  }
  .container {
    margin-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5em;
  }
  #premisubs-link {
    font-size: 1.5rem;
  }
}

/* Card logos and text */
.card-logo {
  display: block;
  margin: 0 auto 1rem auto;
  width: 75px;
  height: 75px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.card-title {
  min-height: 2.5rem;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: black;
  font-family: 'Helvetica', sans-serif;
}

.card-description {
  min-height: 2rem;
  font-size: 1rem;
  color: #555;
  font-family: 'Helvetica', sans-serif;
}

/* Access Button Styling */
.access-btn {
  background-color: white;
  color: black;
  font-weight: bold;
  border: 2px solid black;
  border-radius: 25px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: block;
  margin: 1rem auto 0 auto;
}

.access-btn:hover {
  background-color: black;
  color: white;
}

/* Disable scrolling when menu is open */
body.menu-open {
  overflow: hidden;
}

body.menu-open .content-wrapper,
body.menu-open .footer,
body.menu-open .top-notch {
  pointer-events: none;
}

/* Ensure the text bar also blurs when the menu is open */
body.menu-open #text-bar {
  filter: blur(5px);
  pointer-events: none;
}

#content-wrapper {
  flex: 1 0 auto !important;
}

/* Login Popup Overlay & Container Styling */
.login-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 10px;
}

.login-popup {
  background-color: #F8F5EB;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
  width: 300px;
}

/* Fixed Header Container for Menu Toggle and PREMISUBS text */
#header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #F8F5EB;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-notch {
  position: relative;
  margin: 0;
}

/* Ensure body content does not hide behind the fixed header */
.content-wrapper {
  padding-top: 70px;
}

/* ---------- New Feature: Rotating Text Bar Under Header ---------- */
#text-bar {
  background-color: black;
  color: white;
  text-align: center;
  padding: 10px;
  font-size: 1rem;
  width: 100%;
  margin-top: 40px; /* Adjusted margin to position the text bar up */
}
