/* ============================================================
   Alaadin's DocsPodcast — Premium Dark Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Dark surface palette */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-elevated: #1c2128;
  --bg-overlay: rgba(13, 17, 23, 0.85);

  /* Accent colors */
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --accent-pink: #f778ba;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-cyan: #39d2c0;

  /* Gradient accents */
  --gradient-primary: linear-gradient(135deg, #58a6ff 0%, #bc8cff 100%);
  --gradient-secondary: linear-gradient(135deg, #f778ba 0%, #bc8cff 100%);
  --gradient-success: linear-gradient(135deg, #3fb950 0%, #39d2c0 100%);
  --gradient-danger: linear-gradient(135deg, #f85149 0%, #f778ba 100%);

  /* Text colors */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --text-link: #58a6ff;

  /* Border colors */
  --border-default: #30363d;
  --border-muted: #21262d;
  --border-accent: rgba(88, 166, 255, 0.4);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing & shapes */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows for dark backgrounds */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow-blue: 0 0 20px rgba(88, 166, 255, 0.15);
  --shadow-glow-purple: 0 0 20px rgba(188, 140, 255, 0.15);
}

/* ============ Base & Body ============ */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(88, 166, 255, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(188, 140, 255, 0.06), transparent),
    radial-gradient(ellipse 50% 50% at 50% 0%, rgba(247, 120, 186, 0.04), transparent);
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--text-primary);
  font-weight: 600;
}

/* ============ Layout ============ */

.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ============ Header ============ */

.app-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.75rem 2rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at top left, rgba(88, 166, 255, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(188, 140, 255, 0.06), transparent 60%);
  z-index: 0;
}

.app-header > * {
  position: relative;
  z-index: 1;
}

.app-logo {
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.app-logo:hover {
  transform: rotate(5deg) scale(1.08);
  box-shadow: 0 10px 30px rgba(88, 166, 255, 0.4);
}

.app-logo i {
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.app-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.app-title {
  font-size: 1.9rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.03em;
}

.description-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.taglines {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.app-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

.app-description:first-child {
  color: var(--accent-blue);
  -webkit-text-fill-color: unset;
  background: none;
}

.app-description:last-child {
  color: var(--accent-purple);
  -webkit-text-fill-color: unset;
  background: none;
}

.ai-badge {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
  -webkit-text-fill-color: white;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.ai-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  transform: rotate(45deg);
  animation: badgeShine 3s linear infinite;
}

@keyframes badgeShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* ============ Cards ============ */

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-blue);
}

.card-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header i {
  color: var(--accent-blue);
  transition: transform 0.3s;
}

.card:hover .card-header i {
  transform: scale(1.15);
}

.card-body {
  padding: 1.5rem;
}

/* ============ Upload Area ============ */

.upload-area {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.upload-area:hover,
.upload-area-active {
  border-color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.05);
  box-shadow: var(--shadow-glow-blue);
}

.upload-area:hover .upload-icon {
  transform: translateY(-6px);
  color: var(--accent-purple);
}

.upload-icon {
  font-size: 2.8rem;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
  transition: all 0.3s;
}

.upload-text {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 500;
}

/* ============ Buttons ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.25s;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 14px rgba(63, 185, 80, 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(63, 185, 80, 0.5);
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  box-shadow: 0 4px 14px rgba(248, 81, 73, 0.35);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(248, 81, 73, 0.5);
  filter: brightness(1.1);
}

.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

/* ============ File List ============ */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-muted);
  transition: all 0.25s;
  position: relative;
}

.file-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 3px 0 0 3px;
}

.file-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.file-item:hover::before {
  opacity: 1;
}

.file-item-selected {
  background: rgba(88, 166, 255, 0.08);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.file-item-selected::before {
  opacity: 1;
}

.file-icon {
  font-size: 1.3rem;
  margin-right: 0.75rem;
  transition: transform 0.3s;
  width: 28px;
  text-align: center;
}

.fa-file-pdf { color: #f85149; }
.fa-file-word { color: #58a6ff; }
.fa-file-excel { color: #3fb950; }
.fa-file-powerpoint { color: #d29922; }
.fa-file-alt { color: var(--text-secondary); }
.fa-file-csv { color: #3fb950; }
.fa-file-archive { color: #bc8cff; }
.fa-file-image { color: #58a6ff; }
.fa-file-audio { color: #bc8cff; }
.fa-file-video { color: #f85149; }
.fa-file-code { color: #d29922; }

.file-item:hover .file-icon {
  transform: scale(1.15);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.file-name {
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s;
}

.file-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-size, .file-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.file-size i, .file-date i {
  font-size: 0.75rem;
  opacity: 0.6;
}

.file-item:hover .file-name {
  color: var(--accent-blue);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============ Tabs ============ */

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 0;
}

.tab {
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.tab.active {
  color: var(--accent-blue);
  background: var(--bg-tertiary);
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(88, 166, 255, 0.05);
}

.tab i {
  transition: transform 0.3s;
}

.tab:hover i, .tab.active i {
  transform: scale(1.15);
}

.tab-content {
  padding: 0.75rem 0;
}

/* ============ Chat UI ============ */

.chat-container {
  height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  margin-bottom: 0.75rem;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* Custom scrollbar for chat */
.chat-container::-webkit-scrollbar {
  width: 6px;
}
.chat-container::-webkit-scrollbar-track {
  background: transparent;
}
.chat-container::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
.chat-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.chat-message {
  display: flex;
  margin-bottom: 0.5rem;
  transition: transform 0.2s;
}

.chat-message:hover {
  transform: translateY(-1px);
}

.chat-message.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.chat-message:hover .message-avatar {
  transform: scale(1.08);
}

.user .message-avatar {
  order: 1;
  margin-right: 0;
  margin-left: 0.75rem;
  background: var(--gradient-secondary);
  box-shadow: 0 4px 12px rgba(247, 120, 186, 0.3);
}

.bot-avatar {
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.message-bubble {
  max-width: 80%;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  transition: box-shadow 0.3s;
  position: relative;
}

.chat-message:hover .message-bubble {
  box-shadow: var(--shadow-md);
}

.user .message-bubble {
  background: rgba(247, 120, 186, 0.1);
  border: 1px solid rgba(247, 120, 186, 0.2);
  border-bottom-right-radius: 4px;
}

.bot .message-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-bottom-left-radius: 4px;
}

.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Typing cursor */
.typing-animation {
  position: relative;
}

.typing-animation::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 16px;
  background-color: var(--accent-blue);
  animation: cursor-blink 0.7s infinite;
  position: absolute;
  margin-left: 2px;
  bottom: 2px;
  border-radius: 2px;
}

.message-content:not(.typing-animation)::after {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Markdown styling in messages */
.message-content p {
  margin-bottom: 0.8rem;
  line-height: 1.7;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
  color: var(--accent-blue);
  font-weight: 600;
  position: relative;
  padding-left: 0.6rem;
}

.message-content h1::before,
.message-content h2::before,
.message-content h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 3px;
}

.message-content h1 { font-size: 1.4rem; }
.message-content h2 { font-size: 1.25rem; }
.message-content h3 { font-size: 1.1rem; }

.message-content ul,
.message-content ol {
  margin: 0.6rem 0 0.8rem 1.5rem;
  line-height: 1.7;
}

.message-content ul li,
.message-content ol li {
  margin-bottom: 0.4rem;
}

.message-content ul li::marker {
  color: var(--accent-blue);
}

.message-content ol li::marker {
  color: var(--accent-blue);
  font-weight: 600;
}

.message-content blockquote {
  border-left: 3px solid var(--accent-purple);
  padding: 0.6rem 1rem;
  margin: 0.8rem 0;
  background: rgba(188, 140, 255, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.message-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.message-content em {
  font-style: italic;
  color: var(--accent-purple);
}

.message-content code {
  font-family: var(--font-mono);
  background: rgba(88, 166, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: var(--accent-cyan);
  border: 1px solid rgba(88, 166, 255, 0.15);
}

.message-content pre {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85em;
  margin: 0.8rem 0;
  border: 1px solid var(--border-default);
}

.message-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--text-primary);
  white-space: pre;
  display: block;
  line-height: 1.6;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.message-content table th,
.message-content table td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-default);
  text-align: left;
}

.message-content table th {
  background: var(--bg-tertiary);
  color: var(--accent-blue);
  font-weight: 600;
}

.message-content table tr:nth-child(even) {
  background: rgba(88, 166, 255, 0.03);
}

.message-content a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.message-content a:hover {
  border-bottom-color: var(--accent-blue);
}

.message-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 0.8rem 0;
  border: 1px solid var(--border-default);
}

.message-content hr {
  border: none;
  height: 1px;
  background: var(--border-default);
  margin: 1.2rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-timestamp {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-align: right;
}

/* Chat input */
.chat-input-container {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.25s;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
  background: var(--bg-elevated);
}

.chat-submit {
  background: var(--gradient-primary);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.35);
  flex-shrink: 0;
}

.chat-submit:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  width: fit-content;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

.typing-indicator span {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--accent-blue);
  border-radius: 50%;
  animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-4px); opacity: 1; }
}

/* ============ Podcast Generator ============ */

.podcast-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-tertiary);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-muted);
}

.option-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.option-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all 0.25s;
  font-family: var(--font-sans);
  cursor: pointer;
  font-size: 0.9rem;
}

.option-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.option-select:hover {
  border-color: var(--border-accent);
}

/* Script container */
.script-container {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  transition: border-color 0.3s;
}

.script-container:hover {
  border-color: var(--border-accent);
}

.script-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
}

.script-title {
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-blue);
  font-size: 0.95rem;
}

.script-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.script-toggle:hover {
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
}

.script-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--bg-secondary);
  white-space: pre-line;
  color: var(--text-primary);
  scroll-behavior: smooth;
}

/* ============ Audio Player ============ */

.audio-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-default);
  margin-top: 1.25rem;
  transition: border-color 0.3s;
}

.audio-container:hover {
  border-color: var(--border-accent);
}

.audio-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.95rem;
}

.audio-title i {
  color: var(--accent-purple);
}

.audio-player {
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  filter: invert(1);
}

.audio-progress {
  height: 6px;
  width: 100%;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-bottom: 0.4rem;
  overflow: hidden;
}

.audio-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 0;
  transition: width 0.2s linear;
  border-radius: 3px;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.audio-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ============ Loading ============ */

.loading {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(88, 166, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent-blue);
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ Alerts ============ */

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  border-left: 3px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.alert i {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.alert-info {
  background: rgba(88, 166, 255, 0.07);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.alert-success {
  background: rgba(63, 185, 80, 0.07);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.alert-warning {
  background: rgba(210, 153, 34, 0.07);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.alert-danger {
  background: rgba(248, 81, 73, 0.07);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ============ Footer ============ */

.app-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-muted);
}

/* ============ Responsive ============ */

@media (max-width: 768px) {
  .app-container {
    padding: 0.75rem;
  }

  .podcast-options {
    grid-template-columns: 1fr;
  }

  .chat-container {
    height: 380px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .app-header {
    flex-direction: column;
    padding: 1.25rem;
    align-items: flex-start;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .app-description {
    font-size: 0.8rem;
  }

  .description-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .ai-badge {
    align-self: flex-start;
  }

  .tabs {
    gap: 0;
  }

  .tab {
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
  }
}

/* ============ Utility Classes ============ */

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.w-100 { width: 100%; }

/* ============ Selection Colors ============ */

::selection {
  background: rgba(88, 166, 255, 0.3);
  color: white;
}

::-moz-selection {
  background: rgba(88, 166, 255, 0.3);
  color: white;
}