/*
   AI Генератор описаний товаров - Светлая тема
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

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

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --bg-gradient-start: rgba(139, 92, 246, 0.05);
  --bg-gradient-end: rgba(59, 130, 246, 0.03);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-bg: rgba(124, 58, 237, 0.08);
  --accent-glow: rgba(124, 58, 237, 0.2);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-accent: 0 4px 20px rgba(124, 58, 237, 0.25);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

html, body {
  height: 100%;
}

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

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 100%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebars */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.ad-block {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s ease;
}

.ad-block.refresh {
  animation: shimmer 0.6s ease;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ad-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 24px 16px;
  border: 2px dashed var(--border-color);
  transition: all 0.3s ease;
}

.ad-placeholder:hover {
  border-color: var(--accent-light);
  background: var(--accent-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.ad-placeholder .ad-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.ad-iframe {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* Main Content */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* Top Ad Banner */
.ad-top {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  padding: 16px;
  text-align: center;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.ad-top-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 14px 28px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.ad-top-placeholder:hover {
  border-color: var(--accent-light);
  border-style: solid;
}

.ad-top-iframe {
  width: 100%;
  max-width: 728px;
  height: 90px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* Container */
.container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 36px;
}

h1 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1e293b 0%, #7c3aed 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* Input Section */
.input-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.input-section:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-bg);
}

.input-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.text-input {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

/* Button */
.btn {
  padding: 16px 32px;
  border-radius: var(--radius-md);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: 60px 20px;
}

.loading.active {
  display: block;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

/* Error */
.error-message {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--error);
  margin-top: 16px;
  font-size: 0.9rem;
  display: none;
  animation: slideIn 0.3s ease;
}

.error-message.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Results */
.results-section {
  display: none;
}

.results-section.active {
  display: block;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  animation: cardAppear 0.5s ease backwards;
}

.result-card:nth-child(1) { animation-delay: 0s; }
.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.2s; }
.result-card:nth-child(4) { animation-delay: 0.3s; }

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

.result-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.result-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.result-lang {
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-content {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 18px;
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border-color);
}

/* Properties */
.properties-grid {
  display: grid;
  gap: 12px;
}

.property-item {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.property-item:hover {
  border-color: var(--accent-light);
  transform: translateX(4px);
}

.property-both {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.property-lang {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Copy Button */
.copy-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Responsive */
@media (max-width: 1200px) {
  .sidebar { width: 160px; }
}

@media (max-width: 1000px) {
  .sidebar { display: none; }
  .container { padding: 36px 24px; }
}

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  .subtitle { font-size: 0.95rem; }
  .container { padding: 24px 16px; }
  .input-section { padding: 24px 20px; border-radius: var(--radius-lg); }
  .result-card { padding: 18px; border-radius: var(--radius-md); }
  .property-both { grid-template-columns: 1fr; gap: 14px; }
  .text-input { padding: 14px; font-size: 0.95rem; }
  .btn { padding: 14px 24px; font-size: 0.95rem; }
  .result-header { flex-direction: column; align-items: flex-start; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection */
::selection {
  background: var(--accent-bg);
  color: var(--accent);
}
