:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-active: #4f46e5;
  --accent: #4f46e5;
  --accent-purple: #9333ea;
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  background-image: 
    radial-gradient(ellipse at top, rgba(79, 70, 229, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(147, 51, 234, 0.1) 0%, transparent 50%);
}

.container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

.header {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px 0;
}

.header h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 40px;
  height: fit-content;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  font-size: 18px;
}

.card-title .badge {
  font-size: 11px;
  background: rgba(79, 70, 229, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: none;
  letter-spacing: 0;
}

input[type="text"] {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(17, 24, 39, 0.8);
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.2s ease;
  outline: none;
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.char-counter {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.text-input-wrapper {
  position: relative;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.option {
  padding: 14px 12px;
  text-align: center;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.option .option-icon {
  font-size: 20px;
}

.option .option-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.option:hover {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.option:hover .option-label {
  color: var(--text-primary);
}

.option.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

.option.active .option-label {
  color: #fff;
}

.option .check-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--accent);
  font-size: 14px;
  display: none;
}

.option.active .check-icon {
  display: block;
}

.option {
  position: relative;
}

.env-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .env-grid {
    grid-template-columns: 1fr;
  }
}

.env-option {
  padding: 12px 16px;
  text-align: center;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  color: var(--text-secondary);
}

.env-option:hover {
  background: rgba(31, 41, 55, 0.8);
  color: var(--text-primary);
}

.env-option.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%);
  border-color: var(--accent);
  color: #fff;
}

.env-placeholder {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.booster-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .booster-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.booster {
  padding: 12px;
  text-align: center;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.booster .booster-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.booster .booster-desc {
  font-size: 10px;
  color: var(--text-muted);
}

.booster:hover {
  background: rgba(31, 41, 55, 0.8);
}

.booster:hover .booster-label {
  color: var(--text-primary);
}

.booster.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(147, 51, 234, 0.2) 100%);
  border-color: var(--accent);
}

.booster.active .booster-label {
  color: #fff;
}

.booster .check-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--accent);
  font-size: 12px;
  display: none;
}

.booster.active .check-icon {
  display: block;
}

.generate-btn {
  width: 100%;
  padding: 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.generate-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.4);
}

.generate-btn:disabled {
  background: rgba(55, 65, 81, 0.5);
  color: var(--text-muted);
  cursor: not-allowed;
}

.generate-btn .spinner {
  animation: spin 1s linear infinite;
}

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

.output-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
  display: none;
}

.output-card.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.output-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prompt-display {
  background: rgba(17, 24, 39, 0.8);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.prompt-display p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-wrap: break-word;
}

.platform-section {
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

.platform-section p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.platform-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.platform-btn:hover {
  transform: translateY(-2px);
}

.platform-btn.chatgpt:hover {
  border-color: #10a37f;
  color: #10a37f;
}

.platform-btn.gemini:hover {
  border-color: #ea580c;
  color: #ea580c;
}

.platform-btn.midjourney:hover {
  border-color: #a855f7;
  color: #a855f7;
}

.platform-btn.ideogram:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  border-radius: 12px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.4);
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes slideDown {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 20px); }
}

.toast.hiding {
  animation: slideDown 0.3s ease forwards;
}

.scroll-section {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
}

.scroll-section::-webkit-scrollbar {
  width: 6px;
}

.scroll-section::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.5);
  border-radius: 3px;
}

.scroll-section::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.5);
  border-radius: 3px;
}

/* Welcome Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

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

.popup-content {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(79, 70, 229, 0.3);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px 50px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 0 60px rgba(79, 70, 229, 0.3);
}

.popup-content p {
  font-size: 18px;
  color: #e5e7eb;
  line-height: 1.8;
  min-height: 60px;
  margin-bottom: 30px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: #4f46e5;
  margin-left: 2px;
  animation: blink 0.7s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.enter-btn {
  padding: 14px 50px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.enter-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.5);
}