:root {
  --bg-color: #0B0A10;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3AF;
  --accent-color: #8B5CF6;
  --accent-hover: #7C3AED;
  --accent-glow: rgba(139, 92, 246, 0.5);
  --danger-color: #EF4444;
  --success-color: #10B981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 4rem;
  margin-top: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--accent-color);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Glass Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Input Section */
.input-section {
  text-align: center;
  margin-bottom: 3rem;
  transition: transform 0.3s ease;
}

.input-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.input-section p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.input-wrapper {
  margin-bottom: 2rem;
  position: relative;
}

.input-wrapper::after {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(45deg, var(--accent-color), transparent, var(--accent-color));
  z-index: -1;
  border-radius: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-wrapper:focus-within::after {
  opacity: 0.3;
}

textarea {
  width: 100%;
  min-height: 150px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

textarea:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(0, 0, 0, 0.5);
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

/* Button */
.primary-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s ease;
}

.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.primary-btn:hover::before {
  left: 100%;
}

.primary-btn:active {
  transform: translateY(0);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Loading State */
.loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
  animation: fadeIn 0.5s ease forwards;
}

.loader {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

.loading-text {
  color: var(--accent-color);
  font-weight: 500;
  letter-spacing: 0.5px;
  animation: pulse 2s infinite ease-in-out;
}

/* Results Section */
.results-section {
  animation: fadeIn 0.8s ease forwards;
}

.results-section h2 {
  font-size: 2rem;
  margin: 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.secondary-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .results-header {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}

.video-result-card {
  margin-bottom: 3rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 20px;
  padding: 2rem;
}

.video-title {
  font-size: 1.25rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.carousel-card {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.carousel-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.3);
}

.carousel-tag {
  display: inline-block;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.screen-block {
  margin-bottom: 1.25rem;
}

.screen-block:last-child {
  margin-bottom: 0;
}

.screen-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.screen-content {
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.screen-content strong {
  color: #fff;
  display: block;
  margin-bottom: 0.25rem;
}

.screen-content em {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: normal;
  border-left: 2px solid var(--accent-color);
  padding-left: 0.5rem;
}

.caption-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.caption-title {
  font-size: 0.85rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.caption-content {
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #D1D5DB;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Footer */
.footer {
  margin-top: auto;
  text-align: center;
  padding-top: 3rem;
  color: rgba(255,255,255,0.3);
  font-size: 0.9rem;
}

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

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

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

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }
  
  .glass-panel {
    padding: 1.5rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
}
