/* Brainy Tech - Main CSS */
/* Modern, Responsive, Dark Mode Support */

:root {
  /* Light Theme Colors - Brainy Tech Corporate */
  --color-primary: #5C17F3;
  --color-primary-dark: #4A12C7;
  --color-primary-light: #7E3FF7;

  --color-secondary: #9D4EDD;
  --color-secondary-dark: #7B2CBF;

  --color-accent: #06b6d4;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  --color-background: #f8f9fd;
  --color-surface: rgba(255, 255, 255, 0.7);
  --color-surface-hover: rgba(255, 255, 255, 0.9);

  --color-text: #1a202c;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;

  --color-border: rgba(92, 23, 243, 0.15);
  --color-border-dark: rgba(92, 23, 243, 0.25);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* Dark Theme */
[data-theme="dark"] {
  --color-background: #0f172a;
  --color-surface: rgba(30, 41, 59, 0.7);
  --color-surface-hover: rgba(51, 65, 85, 0.8);

  --color-text: #f1f5f9;
  --color-text-secondary: #cbd5e1;
  --color-text-muted: #94a3b8;

  --color-border: rgba(255, 255, 255, 0.1);
  --color-border-dark: rgba(255, 255, 255, 0.2);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background:
    radial-gradient(circle at center, rgba(92, 23, 243, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f8f9fd 0%, #f3f5fc 100%);
  background-size: 12px 12px, 100% 100%;
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  transition: background var(--transition-base), color var(--transition-base);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(92, 23, 243, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(157, 78, 221, 0.12) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at center, rgba(92, 23, 243, 0.05) 1px, transparent 1px),
    var(--color-background);
  background-size: 12px 12px;
  background-attachment: fixed;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(92, 23, 243, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(157, 78, 221, 0.08) 0%, transparent 50%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
}

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

a:hover {
  color: var(--color-primary-dark);
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-2xl) 0;
}

.card {
  background: var(--color-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: 0 20px 60px rgba(92, 23, 243, 0.15);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: 0 25px 70px rgba(92, 23, 243, 0.2);
  transform: translateY(-2px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btnPrimary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  box-shadow: 0 10px 30px rgba(92, 23, 243, 0.3);
}

.btnPrimary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-secondary-dark));
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(92, 23, 243, 0.4);
}

.btnSecondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btnSecondary:hover {
  background: var(--color-surface-hover);
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fadeIn {
  animation: fadeIn var(--transition-base) ease-in;
}

.slideUp {
  animation: slideUp var(--transition-base) ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }

  .container {
    padding: 0 var(--spacing-md);
  }

  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dark Mode Transition - No Flash */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-duration: var(--transition-base);
  transition-timing-function: ease-in-out;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 350px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.toast-show {
    transform: translateY(0);
    opacity: 1;
}

[data-theme="dark"] .toast {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
}

[data-theme="dark"] .toast-message {
    color: #f1f5f9;
}

.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

[data-theme="dark"] .toast-close {
    color: #94a3b8;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        left: 16px;
        right: 16px;
        transform: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}
