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

:root {
  --bg-color: #f3f4f6;
  --text-color: #1f2937;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-text: #1f2937;
  --input-border: #d1d5db;
  --error-color: #ef4444;
  --table-border: rgba(0, 0, 0, 0.1);
  --table-header: rgba(0, 0, 0, 0.05);
}

.dark {
  --bg-color: #0f172a;
  --text-color: #f8fafc;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --primary-color: #60a5fa;
  --primary-hover: #3b82f6;
  --input-bg: rgba(30, 41, 59, 0.8);
  --input-text: #f8fafc;
  --input-border: #334155;
  --table-border: rgba(255, 255, 255, 0.1);
  --table-header: rgba(255, 255, 255, 0.05);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.5s ease, color 0.5s ease;
  overflow: hidden;
}

/* Background animated mesh */
.background-mesh {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: 
    radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.2) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(168, 85, 247, 0.2) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.2) 0px, transparent 50%);
  animation: mesh-movement 15s ease-in-out infinite alternate;
}

.dark .background-mesh {
  background-image: 
    radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
}

@keyframes mesh-movement {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(2%, 2%); }
  100% { transform: scale(1) translate(-2%, -2%); }
}

.auth-container, .admin-container {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

.admin-container {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slide-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-logo {
  max-height: 80px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.auth-header {
  text-align: center;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-header p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.input-group input, .input-group select {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.submit-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.submit-btn:hover {
  background: var(--primary-hover);
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  text-align: center;
  padding: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--text-color);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.loader {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

.skeleton {
  background: linear-gradient(90deg, rgba(200,200,200,0.1) 25%, rgba(200,200,200,0.2) 50%, rgba(200,200,200,0.1) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

.skeleton-logo { width: 100%; height: 80px; border-radius: 12px; }
.skeleton-text { width: 80%; height: 24px; margin: 0 auto; }
.skeleton-input { width: 100%; height: 48px; border-radius: 12px; }

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Admin Specific Styles */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.admin-header-actions {
  display: flex;
  gap: 1rem;
}

.admin-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-color);
}

.admin-tab.active {
  background: var(--primary-color);
  color: white;
}

.admin-tab:hover:not(.active) {
  background: var(--glass-border);
}

.admin-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--table-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--table-border);
}

.admin-table th {
  background: var(--table-header);
  font-weight: 600;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  color: var(--text-color);
  opacity: 0.7;
  transition: all 0.2s;
}

.action-btn:hover {
  opacity: 1;
  background: var(--glass-border);
}

.action-btn.delete:hover {
  color: var(--error-color);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--text-color);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--glass-border);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary-color);
}