@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;700&display=swap');

:root {
  --bg-primary: #121220;
  --bg-container: #1b1b2f;
  --bg-input: #23233c;
  --bg-card: #20203a;
  
  --text-main: #e0e0e0;
  --text-muted: #a0a0b0;
  --accent-cyan: #00ffff;
  --accent-cyan-hover: #00e0e0;
  --accent-green: #00ff66;
  --accent-red: #ff4444;

  --border-radius: 12px;
  --transition-speed: 0.3s;
  
  /* Shadows */
  --shadow-glow: 0 4px 15px rgba(0, 255, 255, 0.15);
  --shadow-glow-hover: 0 8px 25px rgba(0, 255, 255, 0.25);
  --card-bg: var(--bg-card); /* For compatibility */
}

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

body {
  font-family: 'Exo 2', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 30px 20px;
}

.container {
  background-color: var(--bg-container);
  padding: 30px 40px;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.1);
  width: 100%;
  max-width: 550px;
  margin-bottom: 20px;
  animation: fadeInSlideUp var(--transition-speed) ease-out forwards;
}

h1, h2, h3 {
  color: #fff;
  font-family: 'Exo 2', sans-serif;
  text-align: center;
  margin-bottom: 20px;
}

h3 {
  color: var(--accent-cyan);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 14px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Exo 2', sans-serif;
  transition: all var(--transition-speed) ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
  background-color: #2a2a46;
}

.btn {
  display: inline-block;
  background-color: var(--accent-cyan);
  color: var(--bg-primary);
  padding: 14px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  font-family: 'Exo 2', sans-serif;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 255, 255, 0.2);
}

.btn:hover {
  background-color: var(--accent-cyan-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 255, 255, 0.4);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 255, 255, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: rgba(0, 255, 255, 0.1);
  color: var(--accent-cyan-hover);
  box-shadow: 0 4px 10px rgba(0, 255, 255, 0.1);
}

.btn-success {
  background-color: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 255, 102, 0.2);
}

.btn-success:hover {
  background-color: #00e050;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 255, 102, 0.4);
}

.error-message, .success-message, .info-message {
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
  font-weight: 500;
  animation: fadeInSlideUp 0.3s ease-out;
}

.error-message {
  background-color: rgba(255, 68, 68, 0.1);
  color: #ff8888;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.success-message {
  background-color: rgba(0, 255, 102, 0.1);
  color: #77ffaa;
  border: 1px solid rgba(0, 255, 102, 0.3);
}

.info-message {
  background-color: rgba(0, 255, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 255, 255, 0.3);
}

/* Event Cards (Vote Page) */
#event-cards-container {
  position: relative;
  min-height: 450px;
  perspective: 1000px;
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.event-card {
  position: absolute;
  width: 100%;
  max-width: 450px;
  height: 400px;
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: var(--border-radius);
  padding: 30px 20px;
  box-shadow: var(--shadow-glow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform, opacity;
  transform-origin: center bottom;
  user-select: none;
}

.event-card h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.event-card-content p {
  margin-bottom: 8px;
  font-size: 1em;
  color: var(--text-main);
}

.event-card-content strong {
  color: #fff;
}

.vote-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 20px;
}

.vote-btn {
  flex: 1;
  padding: 15px;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vote-btn:hover {
  transform: scale(1.05);
}

.vote-btn:active {
  transform: scale(0.95);
}

.vote-btn.upvote {
  background-color: rgba(0, 255, 102, 0.1);
  color: var(--accent-green);
  border-color: rgba(0, 255, 102, 0.4);
}

.vote-btn.upvote:hover {
  background-color: rgba(0, 255, 102, 0.2);
  box-shadow: 0 4px 15px rgba(0, 255, 102, 0.2);
}

.vote-btn.downvote {
  background-color: rgba(255, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(255, 68, 68, 0.4);
}

.vote-btn.downvote:hover {
  background-color: rgba(255, 68, 68, 0.2);
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.2);
}

/* Results Page */
#results-list {
  list-style: none;
  padding: 0;
}

#results-list li {
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  animation: resultItemAppear 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#results-list li:nth-child(1) { animation-delay: 0.1s; }
#results-list li:nth-child(2) { animation-delay: 0.2s; }
#results-list li:nth-child(3) { animation-delay: 0.3s; }
#results-list li:nth-child(4) { animation-delay: 0.4s; }
#results-list li:nth-child(5) { animation-delay: 0.5s; }

#results-list h3, #results-list h4 {
  color: var(--accent-cyan);
  margin-bottom: 8px;
  text-align: left;
}

#results-list p {
  font-size: 0.95em;
  margin-bottom: 5px;
}

.schedule-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.2);
  margin: 15px 0;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* Conflicts Page */
.conflict-item {
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 255, 255, 0.2);
  padding: 20px;
  margin-bottom: 12px;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.conflict-item h3 {
  text-align: left;
  margin-bottom: 10px;
}

.conflict-item p {
  color: var(--text-main);
  margin-bottom: 15px;
}

.weight-select {
  /* Using global select styling is also an option, but keeping small adjustments */
  margin-top: 5px;
}

/* Loading Spinner */
.loader {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--accent-cyan);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress Bar Styles */
#progress-bar-container {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-bottom: 25px;
  height: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

#progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-cyan);
  border-radius: 8px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

.page-header h1, .page-header h2 {
    margin-bottom: 0;
    text-align: left;
}

/* Keyframes for Animations */
@keyframes fadeInSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes resultItemAppear {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 600px) {
  body { padding: 15px 10px; }
  .container { padding: 25px 20px; }
  .page-header { flex-direction: column; text-align: center; gap: 15px; }
  .page-header h2 { text-align: center; }
  .vote-btn { font-size: 1em; padding: 12px; }
}
