/* Custom variables for a premium, warm dark color palette */
:root {
  --font-family: 'Outfit', sans-serif;
  
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #020617 100%);
  --card-bg: rgba(30, 41, 59, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-glow-hover: rgba(245, 158, 11, 0.15);
  
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.3);
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.3);
  
  --slot-empty: rgba(255, 255, 255, 0.02);
  --slot-empty-hover: rgba(245, 158, 11, 0.05);
  --slot-filled: rgba(245, 158, 11, 0.08);
  --slot-filled-border: rgba(245, 158, 11, 0.25);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --border-radius: 16px;
  --border-radius-sm: 8px;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Spinner / Loader */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Authentication Screen */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  animation: fadeIn 0.5s ease-out;
}

.auth-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  padding: 40px 30px;
  border-radius: var(--border-radius);
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
}

.auth-logo {
  display: inline-flex;
  padding: 16px;
  background: var(--slot-filled);
  border: 1px solid var(--slot-filled-border);
  border-radius: 50%;
  color: var(--primary);
  margin-bottom: 24px;
}

.auth-logo svg {
  width: 32px;
  height: 32px;
}

.auth-card h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* Input Fields */
.input-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.error-msg {
  display: block;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 6px;
  animation: slideDown 0.2s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-dark);
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Main App Layout */
.app-container {
  width: 100%;
  max-width: 960px;
  padding: 20px 0;
  animation: fadeIn 0.6s ease-out;
}

.app-header {
  margin-bottom: 40px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand .badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--slot-filled);
  border: 1px solid var(--slot-filled-border);
  color: var(--primary);
  border-radius: 50px;
  margin-bottom: 8px;
}

.brand h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand .subtitle {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 4px;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid var(--card-border);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
}

/* Info Card */
.intro-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  align-items: center;
}

.intro-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.intro-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(15, 23, 42, 0.4);
  padding: 20px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-item .icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.detail-item strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.detail-item span {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Shift List & Cards */
.shifts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shift-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.shift-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  opacity: 0.5;
  transition: var(--transition);
}

.shift-card:hover {
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 10px 40px -10px var(--card-glow-hover);
}

.shift-card:hover::before {
  opacity: 1;
}

.shift-meta h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.shift-meta .time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--primary);
  background: var(--slot-filled);
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 600;
  border: 1px solid var(--slot-filled-border);
}

.shift-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Slot Styles */
.slot {
  min-height: 72px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  transition: var(--transition);
  position: relative;
  font-size: 1.05rem;
}

.slot-empty {
  background: var(--slot-empty);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}

.slot-empty:hover {
  background: var(--slot-empty-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.slot-filled {
  background: var(--slot-filled);
  border: 1px solid var(--slot-filled-border);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.slot-filled:hover {
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.slot-filled .volunteer-name {
  text-align: center;
  word-break: break-word;
  padding-right: 20px;
}

.slot-filled .delete-icon {
  position: absolute;
  right: 14px;
  color: var(--danger);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  opacity: 0.8;
}

.slot-filled:hover .delete-icon {
  opacity: 1;
  transform: scale(1.1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  background: #1e293b;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.shift-preview {
  margin-top: 8px;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.4);
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.shift-preview .name {
  font-weight: 600;
}

.shift-preview .time {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.delete-preview {
  border-left: 3px solid var(--danger);
  background: var(--danger-bg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Footer Section */
.app-footer {
  margin-top: 60px;
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  margin-top: 10px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: underline;
}

.footer-link-btn:hover {
  color: var(--primary-hover);
}

.legal-panel {
  margin-top: 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: left;
  animation: slideDown 0.3s ease-out;
}

.legal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.legal-section h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 12px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.legal-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .intro-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .shift-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .shift-card::before {
    width: 100%;
    height: 4px;
    border-radius-topleft: var(--border-radius);
    border-radius-topright: var(--border-radius);
    border-radius-bottomleft: 0;
  }
  
  .shift-slots {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .legal-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
