:root {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-color: #333;
    --primary: #00857D;
    --primary-hover: #4338ca;
    --chosen: #00857D;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, h2 {
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: #111;
}

h3 {
    margin-bottom: 0.5rem;
}

/* Voting Page */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.options-grid.hidden{
    display: none;
}

.vote-btn {
    padding: 1rem;
    margin: 0.4rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-color);
}

.vote-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: #eef2ff;
    transform: translateY(-2px);
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.vote-btn.selected {
    background: var(--chosen);
    color: white;
    border-color: var(--chosen);
    opacity: 1;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 999px;
    font-weight: bold;
    font-size: 0.875rem;
}

.status-open { background: #d1fae5; color: #065f46; }
.status-locked { background: #fee2e2; color: #991b1b; }

/* Toast Message */
#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-weight: 500;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Projector Page Styles */
.chart-container {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    display: flex;
    width: 90vw;
    flex-direction: column;
}

.chart-container .admin-panel {
    margin-top: 0.5rem;
    width: auto;
}

.bar-group {
    margin-bottom: 2rem;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.bar-track {
    background: #e5e7eb;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
}

.total-participants {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary);
}

/* Navigation */
nav {
    background: var(--card-bg);
    padding: 1rem 0;
    /* display: flex; */
    justify-content: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 0;
    z-index: 10;
    width: 100vw;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
}

nav a:hover, nav a.active {
    background: var(--primary);
    color: white;
}

/* Admin Page Specific */
.admin-panel {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    width: 90vw;
}

.admin-controls {
    display: none; /* Hidden until logged in */
    flex-direction: column;
    gap: 1rem;
}

.admin-edit-grid {
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.admin-login {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    margin: 0.25rem;
}

button.action-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s;
}

button.action-btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-secondary { background: #6b7280; }

/* Toast Message */
#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-weight: 500;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#toast.show {
    transform: translateX(-50%) translateY(0);
}

/* MODALS */
/* The Modal (background) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  padding-top: 100px; /* Location of the box */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(255, 255, 255); /* Fallback color */
}

/* Modal Content */
.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
}

/* The Close Button */
.close {
  color: #aaaaaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}
