/**
 * Main CSS - Global Styles and Theme Variables
 * Shared across all pages
 */

/* === CSS Variables for Theming === */
:root {
  /* Light Theme Colors */
  --bg-gradient-start: #4f46e5;
  --bg-gradient-mid: #7c3aed;
  --bg-gradient-end: #ec4899;
  --bg-surface: rgba(255, 255, 255, 0.95);
  --text-primary: #333;
  --text-secondary: #666;
  --text-on-surface: #fff;

  --primary-color: #7c3aed;
  --secondary-color: #ec4899;
  --success-color: #22c55e;
  --error-color: #ef4444;
  --warning-color: #f59e0b;

  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.2);

  --border-radius: 15px;
  --transition: all 0.3s ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-gradient-start: #1e1b4b;
  --bg-gradient-mid: #312e81;
  --bg-gradient-end: #581c87;
  --bg-surface: rgba(30, 27, 75, 0.95);
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-on-surface: #f3f4f6;

  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.5);
}

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

/* === Body === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: var(--transition);
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1rem 0;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5,
h6 {
  font-size: 1rem;
}

p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Override link styles for buttons */
a.btn {
  color: white;
}

a.btn:hover {
  color: white;
  text-decoration: none;
}

/* === Control Buttons (Theme + Audio) === */
.control-buttons {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.control-btn {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--bg-surface);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

.control-btn:active {
  transform: translateY(0) scale(0.95);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
}

.btn-secondary {
  background: linear-gradient(45deg, #4f46e5, var(--primary-color));
  color: white;
  margin-left: 10px;
}

.btn-warning {
  background: linear-gradient(45deg, #f59e0b, #d97706);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

/* === Error/Success Notifications === */
.error-notification,
.success-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  max-width: 400px;
  z-index: 2000;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.error-content,
.success-content {
  background: white;
  padding: 15px 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-notification .error-content {
  border-left: 4px solid var(--error-color);
}

.success-notification .success-content {
  border-left: 4px solid var(--success-color);
}

.error-icon,
.success-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.error-message,
.success-message {
  flex: 1;
  color: var(--text-primary);
}

.error-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0 5px;
}

.error-close:hover {
  color: var(--text-primary);
}

/* === Animations === */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* === Responsive === */
@media (max-width: 768px) {
  .control-buttons {
    top: 10px;
    right: 10px;
  }

  .control-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 1rem;
  }

  .error-notification,
  .success-notification {
    top: 70px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}