/* Modernized styles for CSU SGA site */

:root {
  --primary: #002855;
  --secondary: #a8996e;
  --accent: #fcb900;
  --neutral: #f7f9fc;
  --dark: #1a202c;
  --light: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(180deg, var(--neutral), #e8ecef);
  color: var(--dark);
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* About page full-page sections */
.about-page {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
}

.about-page .snap-section {
  scroll-snap-align: start;
  min-height: 100vh;
}

.about-page section.snap-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Hero Header / Navigation */

header {
  position: relative;
  min-height: 100vh;
  color: var(--light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  background-image: url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1400&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
}

header h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0;
}

nav {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

@media (min-width: 600px) {
  nav {
    align-self: center;
    margin-right: 0;
  }
}

nav a {
  color: var(--light);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  backdrop-filter: blur(2px);
  background-color: rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, color 0.3s ease;
  display: block;
}

/* Admin login button */
.admin-icon {
  background: transparent;
  border: none;
  color: var(--light);
  cursor: pointer;
  font-size: 1.25rem;
}

/* Login modal */
.login-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.login-modal .modal-content {
  background: var(--light);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 240px;
}

.login-modal .close {
  align-self: flex-end;
  cursor: pointer;
}

nav a:hover,
nav a:focus {
  background-color: var(--secondary);
  color: var(--dark);
}

@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: stretch;
  }

  nav a {
    width: 100%;
    text-align: center;
  }
}

/* Main Content */

main {
  flex: 1;
  width: min(90%, 1200px);
  margin: 2rem auto;
}

/* Buttons */

.button {
  background: var(--primary);
  color: var(--light);
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  margin: 0.5rem;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.nav-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.button:hover {
  background: var(--secondary);
  color: var(--dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.button.secondary {
  background: var(--secondary);
  color: var(--dark);
}

.button.secondary:hover {
  background: var(--accent);
  color: var(--dark);
}

/* Hero Content */

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.hero-content p {
  max-width: 600px;
  margin: 1rem auto 2rem;
  font-size: 1.25rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Feature cards */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 4rem 1rem;
}

.full-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.feature {
  background: var(--light);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.feature i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Call to Action */

.cta {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--primary);
  color: var(--light);
}

.cta .button {
  margin-top: 1rem;
}

/* Reveal animations */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Forms */

form input,
form select,
form textarea {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: inherit;
}

form button {
  background-color: var(--primary);
  color: var(--light);
  border: none;
  padding: 0.5rem 1rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

/* Embeds */

iframe {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 1rem;
}

/* Footer */

footer {
  background: var(--primary);
  color: var(--light);
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

/* Candidate cards */

.candidate-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  text-align: center;
}

.candidate {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  background-color: var(--light);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  flex: 1 1 500px;
  max-width: 550px;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  display: none;
}

.social-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.social-column img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
}

.candidate-content {
  flex: 1;
  min-width: 0;
}

.candidate-content img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.candidate-content h3 {
  margin-top: 0.5rem;
  text-align: center;
}

.candidate-content iframe {
  width: 100%;
  height: 350px;
  border: none;
  margin-top: 1rem;
  border-radius: 8px;
}

.candidate.show {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

.candidate.hide {
  opacity: 0;
  transform: translateY(20px);
}

@media (max-width: 768px) {
  .candidate-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .candidate {
    justify-content: center;
    align-items: center;
  }

  .candidate-content {
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .candidate-content iframe {
    width: 100%;
    max-width: 100%;
    height: 300px;
  }

  .social-column {
    flex-direction: row;
    justify-content: center;
    margin-bottom: 1rem;
  }

  .social-column img {
    width: 40px;
    height: 40px;
  }

  .candidate-content img {
    max-height: 250px;
  }
}

/* Member grid styles for cabinet and senator sections */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.member-card {
  background: var(--light);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* Scroll arrows */
.scroll-top,
.scroll-down {
  position: fixed;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: var(--light);
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.scroll-top {
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-down {
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-top.show,
.scroll-down.show {
  opacity: 1;
  pointer-events: auto;
}


/* Chatbot */
.chatbot-container {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-messages {
  background: var(--light);
  padding: 1rem;
  border-radius: 8px;
  height: 400px;
  overflow-y: auto;
  border: 1px solid var(--primary);
}

.chat-user {
  text-align: right;
  margin-bottom: 0.5rem;
}

.chat-assistant {
  text-align: left;
  margin-bottom: 0.5rem;
}

.chat-input {
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  padding: 0.5rem;
}

/* Chatbot popup */
#chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  padding: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--light);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

#chatbot-toggle:hover {
  transform: scale(1.05);
}

#chatbot-popup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 320px;
  max-height: 420px;
  background: var(--light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transform: scale(1);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
}

#chatbot-popup.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

#chatbot-popup .chatbot-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--light);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

#chatbot-popup .chatbot-header button {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

#chatbot-popup .chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

#chatbot-popup .chat-input {
  display: flex;
  border-top: 1px solid #eee;
}

#chatbot-popup .chat-input input {
  flex: 1;
  border: none;
  padding: 0.75rem;
}

#chatbot-popup .chat-input button {
  border: none;
  background: var(--primary);
  color: var(--light);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

#media-list img,
#media-list video {
  width: 100%;
  border-radius: 8px;
}
