/* AAU AI Study Studio — Dark Premium Theme */
.study-studio-container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 0 30px;
  min-height: calc(100vh - 180px);
  position: relative;
  overflow-x: clip;
}

/* ══════════════════════════════════════════════
   1. HERO STATE (Mudrik-Inspired AAU Learning Hub)
   ══════════════════════════════════════════════ */
.studio-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px 16px 20px;
  animation: studioFadeIn 0.35s ease forwards;
}

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

.studio-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #34d399;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.2px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.12);
}

.studio-brand-badge svg {
  width: 16px;
  height: 16px;
  stroke: #34d399;
}

.studio-headline {
  font-size: clamp(26px, 4.4vw, 38px);
  font-weight: 900;
  color: #ffffff;
  line-height: 1.28;
  margin-bottom: 10px;
  letter-spacing: -0.6px;
}

.studio-headline-glow {
  background: linear-gradient(135deg, #10b981 0%, #34d399 45%, #a7f3d0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  filter: drop-shadow(0 2px 14px rgba(16, 185, 129, 0.3));
}

.studio-greeting {
  font-size: 15px;
  color: var(--text-dim, #a1a1aa);
  margin-bottom: 28px;
  max-width: 580px;
  line-height: 1.5;
}

/* ── Central Input Card ── */
.studio-card {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, rgba(22, 22, 28, 0.95) 0%, rgba(15, 15, 20, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(16, 185, 129, 0.05);
  backdrop-filter: blur(16px);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: right;
}

.studio-card:focus-within,
.studio-card.is-dragover,
.studio-dock.is-dragover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(16, 185, 129, 0.2);
}

.studio-drop-overlay {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: rgba(9, 13, 11, 0.94);
  backdrop-filter: blur(16px);
  border: 2px dashed #10b981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-card.is-dragover .studio-drop-overlay,
.studio-dock.is-dragover .studio-drop-overlay {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* ── Overlapping Document Visual (Mudrik Style) ── */
.studio-drop-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 170px;
  height: 95px;
  margin-bottom: 12px;
}

.studio-drop-doc {
  width: 62px;
  height: 78px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  position: absolute;
  top: 8px;
  transition: transform 0.2s ease;
}

.studio-doc-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-doc-lines span {
  display: block;
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
}

.studio-doc-lines span:nth-child(1) { width: 85%; }
.studio-doc-lines span:nth-child(2) { width: 70%; }
.studio-doc-lines span:nth-child(3) { width: 50%; }

.studio-doc-badge {
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  display: block;
}

.badge-pdf {
  background: #fee2e2;
  color: #ef4444;
}

.badge-pptx {
  background: #ffedd5;
  color: #f97316;
}

.doc-pdf {
  left: 12px;
  transform: rotate(-12deg);
  z-index: 1;
}

.doc-pptx {
  right: 12px;
  transform: rotate(12deg);
  z-index: 1;
}

.studio-drop-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.65);
  animation: dropArrowBounce 1.1s infinite alternate ease-in-out;
}

@keyframes dropArrowBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.studio-drop-circle svg {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
}

.studio-drop-title {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin-top: 2px;
  letter-spacing: -0.3px;
}

.studio-drop-sub {
  font-size: 13px;
  color: #a7f3d0;
  font-weight: 500;
}

/* ── Selectors Row (Course / Chapter) ── */
.studio-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.studio-select {
  flex: 1;
  min-width: 170px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 8px 12px;
  color: #fafafa;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
  cursor: pointer;
}

.studio-select:focus {
  border-color: rgba(16, 185, 129, 0.6);
}

.studio-select option {
  background: #141419;
  color: #fff;
}

/* ── Attached File Chips ── */
.studio-files-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.studio-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
  max-width: 260px;
  transition: all 0.2s ease;
}

.studio-file-chip.is-uploading {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.studio-file-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}

.studio-file-chip button {
  background: none;
  border: none;
  color: #fb7185;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

/* ── Large Textarea ── */
.studio-textarea {
  width: 100%;
  min-height: 78px;
  max-height: 260px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.6;
  font-family: inherit;
  resize: none;
  outline: none;
  padding: 6px 2px;
  direction: rtl;
}

.studio-textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 14.5px;
}

/* ── Card Footer ── */
.studio-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  gap: 12px;
}

.studio-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim, #a1a1aa);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.studio-action-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.studio-action-btn svg {
  width: 15px;
  height: 15px;
}

.studio-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
  transition: all 0.18s ease;
}

.studio-submit-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45);
}

.studio-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.studio-submit-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Mudrik-Style Action Pills ── */
.studio-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
  max-width: 760px;
  width: 100%;
}

.studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim, #d4d4d8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}

.studio-pill:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.studio-pill svg {
  width: 14px;
  height: 14px;
  stroke: #34d399;
}

/* ══════════════════════════════════════════════
   2. ACTIVE WORKSPACE (Full-Width Learning Studio)
   ══════════════════════════════════════════════ */
.studio-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: studioFadeIn 0.3s ease forwards;
}

/* ── Top Bar ── */
.studio-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  gap: 12px;
  flex-wrap: wrap;
}

.studio-session-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.studio-session-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-session-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.studio-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Chat Messages Stream ── */
.studio-chat-log {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 380px;
  padding-bottom: 120px;
}

.studio-message-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: studioFadeIn 0.25s ease forwards;
}

.studio-message-user {
  align-self: flex-start;
  max-width: 82%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(5, 150, 105, 0.22) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 18px 4px 18px 18px;
  padding: 14px 18px;
  color: #ffffff;
  font-size: 14.5px;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.studio-message-user-header {
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-message-user-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.studio-message-user-images img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.studio-message-assistant {
  width: 100%;
  background: rgba(18, 18, 24, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.studio-message-assistant.has-edu-response {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.studio-message-assistant-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.studio-code-block {
  background: #09090d !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin: 12px 0 !important;
  font-family: 'Fira Code', monospace !important;
  font-size: 13.5px !important;
  color: #38bdf8 !important;
  overflow-x: auto !important;
  direction: ltr !important;
  text-align: left !important;
}

.studio-md-heading {
  color: #ffffff;
  font-weight: 800;
  margin: 18px 0 8px;
  line-height: 1.4;
}

.studio-md-para {
  color: #e4e4e7;
  line-height: 1.75;
  margin-bottom: 12px;
  font-size: 14px;
}

.studio-md-list {
  padding-right: 22px;
  margin-bottom: 12px;
  color: #e4e4e7;
  line-height: 1.75;
}

.studio-md-quote {
  border-right: 3px solid #10b981;
  padding: 8px 14px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
  color: #a7f3d0;
}

.studio-message-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: rgba(18, 18, 24, 0.6);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  color: #34d399;
  font-size: 13.5px;
  font-weight: 600;
}

.studio-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: studioPulse 1.2s infinite ease-in-out;
}

@keyframes studioPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ── Sticky Bottom Dock ── */
.studio-dock {
  position: sticky;
  bottom: 16px;
  width: 100%;
  z-index: 40;
  background: rgba(14, 14, 18, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  padding: 12px 16px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(16, 185, 129, 0.1);
  transition: border-color 0.2s;
}

.studio-dock:focus-within {
  border-color: rgba(16, 185, 129, 0.65);
}

.studio-dock-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.studio-dock-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-dock-textarea {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14.5px;
  line-height: 1.5;
  font-family: inherit;
  resize: none;
  outline: none;
  direction: rtl;
  padding: 6px 4px;
}

.studio-dock-textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* ── History Drawer ── */
.studio-history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.studio-history-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.studio-history-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(360px, 86vw);
  background: #111116;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 121;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 18px;
}

.studio-history-backdrop.is-open .studio-history-drawer {
  transform: translateX(0);
}

.studio-history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.studio-history-head h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.studio-history-search {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
}

.studio-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.studio-history-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-dim, #d4d4d8);
  font-size: 13px;
  text-align: right;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
}

.studio-history-item:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #ffffff;
}

.studio-history-item.is-active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.studio-history-item time {
  font-size: 11px;
  color: var(--text-muted, #71717a);
}

@media (max-width: 768px) {
  .studio-headline {
    font-size: 25px;
  }
  .studio-pills {
    gap: 8px;
  }
  .studio-pill {
    padding: 7px 14px;
    font-size: 12px;
  }
  .studio-card {
    padding: 14px;
  }
  .studio-submit-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ── Live Student Daily AI Quota Indicator ── */
.studio-quota-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 auto 18px;
  padding: 9px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #d1fae5;
  font-size: 12.5px;
  font-weight: 600;
  max-width: min(560px, 100%);
  text-align: center;
}

.studio-quota-pill[hidden] {
  display: none !important;
}

.studio-quota-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
}

.studio-quota-pill strong {
  color: #6ee7b7;
  font-weight: 800;
}

.studio-quota-meta {
  font-size: 11px;
  color: rgba(209, 250, 229, 0.72);
  font-weight: 500;
}

.studio-quota-bar {
  width: min(320px, 100%);
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.studio-quota-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.25s ease;
}

.studio-quota-pill.is-low {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fef3c7;
}

.studio-quota-pill.is-low strong {
  color: #fbbf24;
}

.studio-quota-pill.is-low .studio-quota-bar > span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.studio-quota-pill.is-empty {
  background: rgba(239, 68, 68, 0.11);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

.studio-quota-pill.is-empty strong {
  color: #f87171;
}

.studio-quota-pill.is-empty .studio-quota-bar > span {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.studio-topbar-quota {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #a7f3d0;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.studio-topbar-quota[hidden] {
  display: none !important;
}

.studio-topbar-quota.is-low {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.38);
  color: #fde68a;
}

.studio-topbar-quota.is-empty {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}
