/* Shared CSS Variables and Base Styles */

:root {
  /* Primary Colors */
  --primary: #4A90D9;
  --primary-dark: #3A7BC8;
  --primary-light: #6BA5E7;

  /* Accent Colors */
  --accent: #F5A623;
  --accent-light: #F7B84E;
  --success: #7ED321;
  --warning: #F8E71C;
  --danger: #FF6B6B;

  /* Background Colors */
  --bg: #F8F9FA;
  --bg-secondary: #FFFFFF;
  --card: #FFFFFF;
  --card-hover: #F5F7FA;

  /* Text Colors */
  --text: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-inverse: #FFFFFF;

  /* Border Colors */
  --border: #E5E5E5;
  --border-light: #F0F0F0;
  --border-dark: #D0D0D0;

  /* Shadows */
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #0F0F1A;
  --bg-secondary: #1A1A2E;
  --card: #1A1A2E;
  --card-hover: #252542;

  --text: #E8E8E8;
  --text-secondary: #A0A0A0;
  --text-tertiary: #6B6B6B;

  --border: #2D3748;
  --border-light: #3D3D5C;
  --border-dark: #1A1A2E;

  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition-normal), color var(--transition-normal);
}

/* Utility Classes */
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Loading Animation */
.generating-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.generating-overlay.active {
  display: flex;
}

.loading-animation {
  width: 120px;
  height: 120px;
  position: relative;
}

.loading-circle {
  position: absolute;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-circle:nth-child(1) {
  width: 120px;
  height: 120px;
  background: rgba(74, 144, 217, 0.2);
}

.loading-circle:nth-child(2) {
  width: 80px;
  height: 80px;
  background: rgba(74, 144, 217, 0.4);
  top: 20px;
  left: 20px;
  animation-delay: 0.3s;
}

.loading-circle:nth-child(3) {
  width: 40px;
  height: 40px;
  background: var(--primary);
  top: 40px;
  left: 40px;
  animation-delay: 0.6s;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

.loading-text {
  margin-top: 32px;
  font-size: 18px;
  color: white;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Form Elements */
.input-group {
  margin-bottom: 28px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.input-label .hint {
  font-weight: normal;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}
