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

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --success: #10b981;
  --danger: #ef4444;
  --border-radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(circle at top right, #1e1b4b, transparent 40%),
                    radial-gradient(circle at bottom left, #064e3b, transparent 40%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 1400px;
  padding: 2rem;
  margin: 0 auto;
}

.container-small {
  max-width: 500px;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-danger {
  background: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-muted);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-top: 0.5rem;
}

/* Voting System */
.voting-container {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-top: 1rem;
  height: 65vh; /* Allow scrolling within the viewport */
  overflow: hidden;
}

.voting-column {
  flex: 1;
  background: rgba(30, 41, 59, 0.5);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255,255,255,0.05);
  overflow-y: auto; /* Scrollable column */
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar for columns */
.voting-column::-webkit-scrollbar {
  width: 6px;
}
.voting-column::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}
.voting-column::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.column-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: -1rem; /* Offset padding */
  background: #111827; /* Dark background to cover scrolling items behind */
  z-index: 10;
  padding-top: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.photo-card {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  padding: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  color: #333; /* Dark text for light card */
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card .name-label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
}

.photo-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

.photo-card.matched {
  opacity: 0.5;
  pointer-events: none;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Match Pill */
.match-pill {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  background: #3b82f6;
  color: #ffffff;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.5rem;
  pointer-events: auto; /* Re-enable pointer inside matched card */
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.match-pill button {
  background: none;
  border: none;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 4px;
}
.match-pill button:hover {
  color: #fca5a5;
}

.match-status {
  text-align: center;
  padding: 1rem;
  margin: 1rem 0;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 500;
}
