@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Outfit:wght@300;400;500;600;700&family=Scheherazade+New:wght@400;700&family=Cairo:wght@400;700&display=swap');

:root {
  /* Colors */
  --bg-dark: hsl(222, 47%, 6%);
  --bg-sidebar: hsl(222, 47%, 10%);
  --bg-card: hsl(222, 47%, 12%);
  --bg-card-hover: hsl(222, 47%, 15%);
  --border-color: hsl(222, 47%, 20%);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 70%);
  --text-muted: hsl(215, 15%, 50%);
  
  --primary: hsl(162, 84%, 38%);
  --primary-hover: hsl(162, 84%, 43%);
  --accent: hsl(43, 96%, 56%);
  --accent-hover: hsl(43, 96%, 62%);
  
  /* Font Family */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: 'Amiri', serif;
  
  /* Layout */
  --sidebar-width: 350px;
  --header-height: 70px;
  
  /* Default Font Sizes */
  --arabic-size: 2.2rem;
  --translation-size: 1.1rem;
}

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

html, body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden !important;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Layout Grid */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden !important;
  position: fixed;
  top: 0;
  left: 0;
}

/* Sidebar styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, hsl(222, 47%, 14%) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
}

.brand:hover h1 {
  filter: brightness(1.12);
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  background: linear-gradient(to right, var(--text-primary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  background-color: hsl(222, 47%, 14%);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(162, 84%, 38%, 0.2);
}

.sura-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sura-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sura-item:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-color);
  transform: translateX(4px);
}

.sura-item.active {
  background-color: hsla(162, 84%, 38%, 0.1);
  border-color: var(--primary);
}

.sura-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sura-num {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background-color: hsl(222, 47%, 14%);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.sura-item.active .sura-num {
  background-color: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.sura-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sura-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sura-arabic {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--primary);
}

.sura-item.active .sura-arabic {
  color: var(--accent);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden !important;
  min-height: 0;
  min-width: 0;
}

/* Top bar / Header */
.top-bar {
  height: var(--header-height);
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.active-sura-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.active-sura-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.active-sura-title .badge {
  background-color: hsl(222, 47%, 14%);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  background-color: hsl(222, 47%, 14%);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.reader-mode-tabs {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.2rem;
  background-color: hsl(222, 47%, 8%);
  flex-shrink: 0;
}

.reader-mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.reader-mode-tab.active {
  background-color: var(--primary);
  color: var(--bg-dark);
}

.mushaf-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: calc(100vh - var(--header-height));
}

.mushaf-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background-color: rgba(7, 12, 23, 0.88);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.mushaf-page {
  align-self: center;
  width: min(100%, 820px);
  min-height: auto;
  position: relative;
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1), transparent 12%, transparent 88%, rgba(15, 118, 110, 0.1)),
    radial-gradient(circle at 50% 0%, rgba(185, 28, 28, 0.08), transparent 36%),
    #ebe4c5;
  color: #252018;
  border: 1px solid rgba(15, 118, 110, 0.72);
  box-shadow:
    inset 0 0 0 5px #7f1d1d,
    inset 0 0 0 9px #c44f4f,
    inset 0 0 0 12px rgba(15, 118, 110, 0.68),
    inset 0 0 0 15px rgba(127, 29, 29, 0.34),
    0 18px 50px rgba(0, 0, 0, 0.35);
  padding: clamp(2.25rem, 5vw, 4rem);
}

.mushaf-page::before {
  content: "";
  position: absolute;
  inset: 1.1rem;
  border: 2px solid rgba(127, 29, 29, 0.78);
  box-shadow:
    inset 0 0 0 2px rgba(196, 79, 79, 0.7),
    inset 0 0 0 5px rgba(15, 118, 110, 0.44);
  pointer-events: none;
  z-index: 0;
}

.mushaf-page::after {
  content: "";
  position: absolute;
  inset: 1.25rem;
  background:
    radial-gradient(circle at 0 0, transparent 0 18px, rgba(127, 29, 29, 0.72) 19px 21px, transparent 22px),
    radial-gradient(circle at 100% 0, transparent 0 18px, rgba(127, 29, 29, 0.72) 19px 21px, transparent 22px),
    radial-gradient(circle at 0 100%, transparent 0 18px, rgba(127, 29, 29, 0.72) 19px 21px, transparent 22px),
    radial-gradient(circle at 100% 100%, transparent 0 18px, rgba(127, 29, 29, 0.72) 19px 21px, transparent 22px);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

.mushaf-page-header {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(120px, 2fr) minmax(80px, 1fr);
  gap: 0.75rem;
  align-items: center;
  position: relative;
  color: #7f1d1d;
  font-size: 0.85rem;
  font-weight: 700;
  background-color: rgba(127, 29, 29, 0.12);
  border: 1px solid rgba(127, 29, 29, 0.45);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.mushaf-page-header-left {
  justify-self: start;
  white-space: nowrap;
}

.mushaf-page-header-center {
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  line-height: 1.2;
}

.mushaf-page-header-right {
  justify-self: end;
  white-space: nowrap;
}

.mushaf-arabic-flow {
  direction: rtl;
  text-align: justify;
  position: relative;
  font-family: var(--font-arabic);
  font-size: clamp(1.8rem, 3.4vw, 2.55rem);
  line-height: 2.15;
  color: #252018;
  z-index: 1;
}

.mushaf-sura-heading {
  text-align: center;
  color: #7f1d1d;
  background:
    linear-gradient(90deg, rgba(127, 29, 29, 0.2), rgba(255, 255, 255, 0.34), rgba(127, 29, 29, 0.2));
  border: 2px solid rgba(127, 29, 29, 0.62);
  border-radius: 18px;
  font-size: 2rem;
  line-height: 1.4;
  margin: 1rem 3rem 0.75rem 3rem;
  padding: 0.2rem 1rem;
  font-weight: 700;
}

.mushaf-bismillah {
  text-align: center;
  color: #252018;
  font-size: 1.55rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.mushaf-ayah {
  display: inline;
}

.mushaf-ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05em;
  height: 2.05em;
  margin: 0 0.28em;
  background-color: #c87171;
  color: #7f1d1d;
  clip-path: polygon(
    50% 0%,
    58% 9%,
    69% 5%,
    74% 17%,
    86% 18%,
    88% 31%,
    99% 38%,
    93% 50%,
    99% 62%,
    88% 69%,
    86% 82%,
    74% 83%,
    69% 95%,
    58% 91%,
    50% 100%,
    42% 91%,
    31% 95%,
    26% 83%,
    14% 82%,
    12% 69%,
    1% 62%,
    7% 50%,
    1% 38%,
    12% 31%,
    14% 18%,
    26% 17%,
    31% 5%,
    42% 9%
  );
  font-family: var(--font-arabic);
  font-size: 0.48em;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* Settings Dropdown/Panel */
.config-dropdown-container {
  position: relative;
}

.config-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: transparent;
}

.config-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  padding: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.config-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.slider-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-list-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.checkbox-list-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--bg-card) 10%, transparent 100%);
  pointer-events: none;
}

.checkbox-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 4px;
  padding-bottom: 30px; /* leaves room so the last items are fully viewable above the fade */
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-item input {
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
}

/* Verses Viewer */
.verses-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.verse-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  transition: all 0.2s ease;
}

.verse-card:hover {
  border-color: hsla(162, 84%, 38%, 0.3);
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.3);
}

.verse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.75rem;
}

.verse-num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.verse-location {
  margin-left: 0.65rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: normal;
  white-space: nowrap;
}

.verse-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: var(--text-primary);
  background-color: hsl(222, 47%, 14%);
}

.arabic-text {
  font-family: var(--font-arabic);
  font-size: var(--arabic-size);
  text-align: right;
  line-height: 1.8;
  color: var(--text-primary);
  direction: rtl;
  padding: 0.5rem 0;
}

.translations-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.translation-block {
  border-left: 2px solid var(--primary);
  padding-left: 1.25rem;
}

.translation-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.25rem;
}

.translation-text {
  font-size: var(--translation-size);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Search Results Area */
.search-results-header {
  padding: 1.5rem 2rem;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

.search-results-grid {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.search-match-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-match-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.match-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.match-source {
  font-weight: 600;
  color: var(--accent);
}

.match-arabic {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  text-align: right;
  direction: rtl;
  color: var(--text-primary);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.75rem;
}

.match-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.search-highlight {
  background-color: rgba(245, 158, 11, 0.34);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0 0.16em;
  box-shadow: inset 0 -1px 0 rgba(245, 158, 11, 0.75);
}

/* Glassmorphic overlay for empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
}

.empty-state svg {
  width: 4.5rem;
  height: 4.5rem;
  color: var(--border-color);
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 300px;
  line-height: 1.5;
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Bismillah image style */
.bismillah-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.bismillah-svg {
  fill: var(--primary);
  width: 250px;
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.bismillah-svg:hover {
  opacity: 1;
}

.sura-select-dropdown {
  background-color: hsl(222, 47%, 14%);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 2.25rem 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-chevron-down' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sura-select-dropdown:hover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
}

.sura-select-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(162, 84%, 38%, 0.2);
}

/* Verse Card Highlight pulse animation */
.verse-card.highlighted {
  border-color: var(--accent) !important;
  box-shadow: 0 0 20px hsla(43, 96%, 56%, 0.35);
  animation: highlightPulse 1.5s ease-in-out infinite alternate;
}

@keyframes highlightPulse {
  0% {
    border-color: var(--accent) !important;
    box-shadow: 0 0 25px hsla(43, 96%, 56%, 0.5);
    transform: scale(1.02) translateY(-2px);
  }
  100% {
    border-color: var(--primary);
    box-shadow: 0 0 10px hsla(162, 84%, 38%, 0.1);
    transform: scale(1) translateY(0);
  }
}

/* Last Visited Search Result Card */
.verse-card.last-visited,
.search-match-card.last-visited {
  border-left: 4px solid var(--accent) !important;
  background-color: hsla(43, 96%, 56%, 0.04) !important;
  border-color: hsla(43, 96%, 56%, 0.3) !important;
}

.search-match-card.scroll-focus {
  border-color: var(--accent) !important;
  animation: searchResultFocus 1.6s ease-in-out 2;
}

@keyframes searchResultFocus {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px hsla(43, 96%, 56%, 0.25);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 28px hsla(43, 96%, 56%, 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px hsla(43, 96%, 56%, 0.25);
  }
}

/* Confirmation Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(5, 8, 16, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal.confirm-modal {
  width: min(420px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-backdrop.show .settings-modal.confirm-modal {
  transform: translateY(0) scale(1);
}

.settings-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-sidebar);
}

.settings-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
}

.close-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Active Translations Bar */
.active-translations-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 2rem;
  background-color: hsl(222, 47%, 8%);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: inset 0 -4px 12px -8px rgba(0, 0, 0, 0.5);
}

.bar-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  user-select: none;
}

.tags-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.1rem 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.tags-container::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.translation-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: hsl(222, 47%, 14%);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.translation-tag:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
  transform: translateY(-1px);
}

.tag-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.tag-close:hover {
  background-color: hsla(0, 100%, 50%, 0.2);
  color: #ff5555;
}

.add-translation-btn {
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.add-translation-btn:hover {
  background-color: hsla(162, 84%, 38%, 0.1);
  color: var(--text-primary);
  border-color: var(--primary);
}

/* Responsive Media Queries */
.d-show-mobile {
  display: none !important;
}

@media (max-width: 900px) {
  .d-none-mobile {
    display: none !important;
  }
  .d-show-mobile {
    display: inline !important;
  }

  .top-bar {
    padding: 0 1rem;
  }

  .top-bar-left {
    gap: 0.5rem;
  }

  .active-sura-title {
    gap: 0.5rem;
  }

  .active-sura-title h2 {
    font-size: 1.1rem;
  }

  .controls-group {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .sura-badge {
    display: none !important;
  }

  .mobile-toggle {
    display: block;
  }
  
  .sidebar {
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

/* User Profile Drawer Styles */
.user-drawer-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(5, 8, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.user-drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 450px;
  max-width: 100%;
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-sans);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, hsl(222, 47%, 14%) 100%);
}

.drawer-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.drawer-header .close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.drawer-header .close-btn:hover {
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.user-info-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.drawer-tabs {
  display: flex;
  background-color: hsl(222, 47%, 6%);
  border-radius: 8px;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 0.6rem;
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background-color: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 400px;
}

.list-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.list-item:hover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
}

.list-item .delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  line-height: 1;
}

.list-item .delete-btn:hover {
  color: #f87171;
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
}

/* Auth classes */
.auth-box h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.drawer-input {
  width: 100%;
  background-color: hsl(222, 47%, 6%);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.drawer-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px hsla(162, 84%, 38%, 0.15);
}

.auth-error-alert {
  padding: 0.75rem 1rem;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-success-alert {
  padding: 0.75rem 1rem;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #34d399;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-toggle-link {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.auth-toggle-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle-link a:hover {
  text-decoration: underline;
}
