:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --background: #0f172a;
  --text: #e2e8f0;
  --border: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
  --timer-text: #f1f5f9;
  --progress-bg: #334155;
  --progress-fill: #2563eb;
  --progress-fill-warning: #f59e0b;
  --progress-fill-danger: #ef4444;
}

:root[data-theme="light"] {
  --background: #f8fafc;
  --text: #1e293b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
}

:root[data-theme="dark"] {
  --background: #0f172a;
  --text: #e2e8f0;
  --border: #1e293b;
  --surface: #1e293b;
  --surface-hover: #334155;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Timer Styles */
.timer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
}

.logo-top {
  position: absolute;
  top: 2rem;
  left: 2rem;
  max-width: 40vw;
  height: auto;
  z-index: 10;
}

.timer {
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 90%;
  max-width: 800px;
}

.timer h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--timer-text);
  margin-bottom: 1rem;
  font-weight: 600;
}

.timer h2 {
  font-size: clamp(4rem, 10vw, 8rem);
  color: var(--timer-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  margin: 1rem 0;
}

.bar-container {
  width: 100%;
  height: 1rem;
  background-color: var(--progress-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 2rem;
}

#progress-bar {
  height: 100%;
  width: 100%;
  background-color: var(--progress-fill);
  transition: width 1s linear, background-color 0.3s ease;
  transform-origin: left;
}

#progress-bar.warning {
  background-color: var(--progress-fill-warning);
}

#progress-bar.danger {
  background-color: var(--progress-fill-danger);
}

.next-band {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface-hover);
  border-radius: 0.5rem;
  font-size: 1.25rem;
  color: var(--text);
}

/* Admin Panel Styles */
.admin-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.header h1 {
  font-size: 1.875rem;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-btn {
  color: var(--danger);
  text-decoration: none;
  font-weight: 500;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.theme-toggle:hover {
  background-color: var(--surface-hover);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.section {
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s;
}

.section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.control-panel {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
  background-color: var(--surface);
  color: var(--text);
}

.form-control:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.table th {
  text-align: left;
  padding: 0.75rem;
  background-color: var(--surface-hover);
  font-weight: 600;
}

.table td {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

.table input {
  width: 100%;
  padding: 0.375rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background-color: var(--surface);
  color: var(--text);
}

.table tr:hover {
  background-color: var(--surface-hover);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.logo-preview {
  max-width: 300px;
  margin-top: 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
}

.file-input-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.warning-times {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.user-list {
  list-style: none;
  margin-top: 1rem;
}

.user-list li {
  padding: 0.5rem;
  background-color: var(--surface-hover);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .control-panel {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .table {
    display: block;
    overflow-x: auto;
  }
}