/* static/style.css */
:root {
  --bg-app: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --input-border: #cbd5e1;
  --primary-accent: #4f46e5;
  --primary-hover: #4338ca;
  --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05),
                 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

body {
  background-color: var(--bg-app);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: screen;
  height: 100vh;
}

/* Flex Container Wrapper */
.app-container {
  display: flex;
  width: 100%;
  max-width: 400px;
  padding: 16px;
  box-sizing: border-box;
}

/* Structural Card Framework */
.login-card {
  background-color: var(--card-bg);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-soft);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  box-sizing: border-box;
}

.text-center { text-align: center; }
.mb-8 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 20px; }
.space-y-5 > * + * { margin-top: 20px; }

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

p {
  font-size: 14px;
  margin-top: 4px;
  margin-bottom: 0;
}

/* Custom Interactive Input Forms */
.form-group {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.form-input {
  background-color: #ffffff;
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
  transition: all 0.2s ease-in-out;
}

.form-input:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* Action Execution Buttons */
.btn-primary {
  background-color: var(--primary-accent);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

.btn-primary:hover { background-color: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alert Banner Middleware Framework */
.alert-banner {
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}

.alert-success { background-color: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background-color: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Layout enhancements for editing view dashboards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.section-title {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-top: 24px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: var(--primary-accent);
}

.form-input.pr-10 {
  padding-right: 40px;
}

/* Real-time input validation layouts */
.input-invalid {
  background-color: #fdf2f2 !important; /* Soft validation pink */
  border-color: #f87171 !important;     /* Warning red line */
}

.error-label {
  color: #b91c1c;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* Navigation Dropdown Container */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

/* The hidden sub-menu box */
.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  min-width: 180px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 0;
  z-index: 1000;
  list-style: none;
  margin: 0;
}

/* Dropdown items */
.nav-dropdown .dropdown-menu li a {
  color: var(--text-main);
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  cursor: pointer;
}

/* Hover effects for the items */
.nav-dropdown .dropdown-menu li a:hover {
  background-color: #f1f5f9;
  color: var(--primary-accent);
}

/* Reveal the menu on hover */
.nav-dropdown:hover .dropdown-menu {
  display: block;
}

/* Force visible text and background inside dropdown select options */
/* TODO: Not sure if I still need this. */
select.form-input, select option {
  color: #0f172a !important;
  background-color: #ffffff !important;
}

/* Scoreboard Bar Chart Styling */
.scoreboard-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.chart-row { display: flex; align-items: center; margin-bottom: 16px; gap: 12px; }

.chart-label {
  width: 200px; /* Fixed width so all bars align perfectly */
  text-align: right;
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-container {
  flex-grow: 1;
  background-color: #f1f5f9;
  border-radius: 6px;
  height: 28px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.chart-bar-fill {
  background-color: var(--primary-accent); /* You can make this dynamic based on party later */
  height: 100%;
  width: 0%; /* Set via inline style in JS */
  transition: width 0.8s ease-out;
}

.chart-percentage {
  width: 50px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 14px;
  text-align: right;
}
