/* ========================================
   LogoForge - Logo Generator Styles
   ======================================== */

:root {
  --primary: #6366F1;
  --primary-dark: #4338CA;
  --primary-light: #A78BFA;
  --secondary: #8B5CF6;
  --bg: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --text: #1E293B;
  --text-secondary: #64748B;
  --border: #E2E8F0;
  --success: #059669;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(99,102,241,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

.btn-outline {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo .brand {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav a:hover { color: var(--primary); }

@media (max-width: 768px) {
  .nav a { display: none; }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(180deg, #FEFEFF 0%, #F8FAFC 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 480px;
}

/* Floating Logos */
.hero-visual {
  position: relative;
  height: 400px;
}

.floating-logos {
  position: relative;
  width: 100%;
  height: 100%;
}

.float-logo {
  position: absolute;
  left: var(--x);
  top: var(--y);
  animation: float 4s ease-in-out infinite;
  animation-delay: var(--delay);
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* ========================================
   Generator Section
   ======================================== */
.generator {
  padding: 60px 0 100px;
}

.generator-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .generator-layout { grid-template-columns: 1fr; }
}

/* Controls Panel */
.controls-panel {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-secondary);
}

.control-group {
  margin-bottom: 22px;
}

.control-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.control-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.control-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.control-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: white;
  cursor: pointer;
  outline: none;
}
.control-select:focus { border-color: var(--primary); }

/* Style Grid */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-size: 11px;
  font-weight: 500;
}
.style-card:hover { border-color: var(--primary-light); }
.style-card.active {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
  color: var(--primary);
}
.style-icon { font-size: 20px; }

/* Color Grid */
.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.color-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  cursor: pointer;
  border: 3px solid transparent;
  overflow: hidden;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.color-card:hover { transform: scale(1.08); }
.color-card.active { border-color: var(--text); }
.color-card .color-label {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  font-size: 7px;
  text-align: center;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Icon Grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 2px;
  transition: var(--transition);
  color: var(--text);
}
.icon-card .icon-glyph { font-size: 22px; line-height: 1; }
.icon-card .icon-name { font-size: 10px; line-height: 1; opacity: 0.8; }
.icon-card:hover { border-color: var(--primary-light); }
.icon-card.active {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
}
/* AI 随机按钮高亮 */
.icon-card[data-icon="ai"] {
  border-style: dashed;
  border-color: var(--primary);
  color: var(--primary);
}
.icon-card[data-icon="ai"].active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
}
.control-label .hint { font-size: 11px; opacity: 0.6; font-weight: 400; }

/* Action Buttons */
.action-buttons {
  margin-top: 24px;
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

/* Preview Panel */
.preview-panel {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.preview-container {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

/* Checkerboard pattern for transparency */
.preview-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, #E8E8E8 25%, transparent 25%),
    linear-gradient(-45deg, #E8E8E8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #E8E8E8 75%),
    linear-gradient(-45deg, transparent 75%, #E8E8E8 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  opacity: 0.3;
}

.logo-preview {
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.logo-preview svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
}

/* Variations */
.variations-section {
  margin-top: 24px;
}

.variations-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

.variations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.variation-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.variation-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.variation-card .variation-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  color: var(--text-secondary);
  text-transform: capitalize;
}
.variation-card svg {
  width: 100%;
  height: auto;
  max-height: 100px;
}

/* ========================================
   Features Section
   ======================================== */
.features {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: white;
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========================================
   Loading Animation
   ======================================== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Preview loading state */
.logo-preview.loading {
  opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .hero-title { font-size: 32px; }
  .hero-desc { font-size: 16px; }
  .controls-panel { padding: 20px; }
  .preview-container { padding: 20px; min-height: 300px; }
  .color-grid { grid-template-columns: repeat(5, 1fr); }
  .style-grid { grid-template-columns: repeat(3, 1fr); }
}
