/* ===== VARIABLES ===== */
:root {
  /* Main Theme Colors - with slight transparency */
  --primary-color: rgba(110, 83, 151, 0.85);
  --primary-light: rgba(141, 113, 181, 0.85);
  --primary-dark: rgba(81, 62, 113, 0.85);
  --secondary-color: rgba(247, 181, 56, 0.85);
  --secondary-light: rgba(249, 199, 100, 0.85);
  --secondary-dark: rgba(217, 155, 32, 0.85);

  /* Text Colors - with slight transparency */
  --text-dark: rgba(74, 55, 104, 0.9);
  --text-medium: rgba(110, 83, 151, 0.9);
  --text-light: rgba(248, 249, 250, 0.9);
  --text-muted: rgba(108, 117, 125, 0.9);

  /* UI Colors - Transparent */
  --bg-light: rgba(248, 249, 250, 0.8);
  --bg-medium: rgba(233, 236, 239, 0.8);
  --bg-dark: rgba(33, 37, 41, 0.9);
  --border-light: rgba(222, 226, 230, 0.8);
  --card-bg: rgba(255, 255, 255, 0.8);

  /* Functional Colors */
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;

  /* Typography */
  --font-primary: "Libre Baskerville", "Georgia", serif;

  /* Shadows & Effects */
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 8px 20px rgba(0, 0, 0, 0.18);
  --shadow-glow: 0 0 20px rgba(110, 83, 151, 0.15);
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--primary-color);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  line-height: 1.3;
  color: var(--primary-dark);
  font-weight: 700;
}

button {
  cursor: pointer;
  font-family: var(--font-primary);
  border: none;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-medium);
  border-radius: 12px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 12px;
  border: 3px solid var(--bg-medium);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Selection style */
::selection {
  background-color: var(--primary-light);
  color: white;
}

/* ===== BUTTONS ===== */
.btn {
  cursor: pointer;
  font-family: var(--font-primary);
  border: none;
  background: var(--card-bg);
  border-radius: 12px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--border-light);
  will-change: transform;
}

.btn:hover {
  background: var(--bg-medium);
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-light);
  transform: translateY(-2px);
}

.btn:active {
  box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--primary-color);
  transform: scale(0.98);
}

/* ===== LAYOUT ===== */
.app-container {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.background-image {
  margin: 0;
  padding: 0;
  position: fixed;
  width: 100%;
  height: 100vh;
  background-image: url("https://images.unsplash.com/photo-1504052434569-70ad5836ab65?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80");
  background-size: cover;
  background-position: center;
  z-index: -2;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(33, 37, 41, 0.7);
  z-index: -1;
}

.app-content {
  flex: 1;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* ===== HEADER ===== */
.app-header {
  text-align: center;
  padding: 40px 20px;
  background: var(--primary-color);
  color: var(--text-light);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-medium);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 500;
}

.app-header h1 {
  font-size: 45px;
  margin-bottom: 10px;
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.app-header p {
  font-size: 19px;
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-light);
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  width: 80px;
  height: 80px;
  background: var(--secondary-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: var(--shadow-strong), 0 0 25px rgba(247, 181, 56, 0.5), inset 0 0 0 3px rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.logo i {
  font-size: 36px;
  color: white;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* ===== SEARCH SECTION ===== */
.mode-toggle-section {
  margin-bottom: 20px;
  position: relative;
  z-index: 100;
}

.mode-toggle-container {
  display: flex;
  gap: 15px;
  max-width: 1000px;
  margin: 0 auto;
  justify-content: center;
}

.mode-toggle-btn {
  /* Inherits from .btn */
  flex: 1;
  max-width: 300px;
  padding: 15px 25px;
  color: var(--text-medium);
  font-size: 16px;
  font-weight: bold;
  gap: 10px;
}

/* .mode-toggle-btn::before, :hover, :hover::before are handled by .btn */

.mode-toggle-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-dark);
}

.mode-toggle-btn i {
  font-size: 19px;
}

.search-section {
  margin-bottom: 30px;
  position: relative;
  z-index: 100; /* Ensure search is on top */
}

.search-container {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--border-light);
  padding: 5px;
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
  overflow: hidden;
}

.search-container:focus-within {
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-light);
  background: var(--card-bg);
}

.search-container input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: transparent;
  border-radius: 12px;
  position: relative;
  z-index: 15;
  pointer-events: auto !important;
  font-weight: normal;
}

.search-container input::placeholder {
  color: var(--primary-light);
  opacity: 0.7;
}

.search-container button {
  background: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  transition: all var(--transition-fast);
  position: relative;
  z-index: 15;
  pointer-events: auto !important;
  overflow: hidden;
  box-shadow: var(--shadow-soft), inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.search-container button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-medium), inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* ===== WELCOME MESSAGE ===== */
.welcome-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: auto;
  position: relative;
  border-radius: 15px;
}

.welcome-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.welcome-icon i {
  font-size: 28px;
  color: white;
  position: relative;
  z-index: 1;
}

.welcome-title {
  font-size: 24px;
  color: var(--primary-dark);
  margin-bottom: 5px;
  position: relative;
  display: inline-block;
}

.welcome-title::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  margin-left: -35px;
  width: 70px;
  height: 2px;
  background: var(--primary-light);
}

.welcome-message {
  font-size: 18px;
  color: var(--text-medium);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
  font-weight: normal;
}

.welcome-instructions {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 15px;
  margin-top: 5px;
  position: relative;
  text-align: left;
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--border-light);
}

.welcome-instructions p {
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--primary-dark);
  position: relative;
  z-index: 2;
}

.welcome-instructions ul {
  list-style-type: none;
  padding-left: 5px;
  position: relative;
  z-index: 2;
}

.welcome-instructions li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 24px;
  z-index: 2;
}

.welcome-instructions li i {
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--primary-color);
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
  margin-bottom: 20px;
  position: relative;
  z-index: 50;
}

.teachings-categories-section {
  margin-bottom: 20px;
  position: relative;
  z-index: 50;
}

.categories-section h2,
.teachings-categories-section h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 29px;
  color: var(--text-light);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.category-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--border-light);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
  overflow: hidden;
  will-change: transform;
}

.category-item:hover {
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-light);
  background: var(--bg-medium);
  transform: translateY(-2px);
}

.category-item.active {
  background: var(--primary-color);
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-dark);
}

.category-item.active h3 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-icon {
  width: 60px;
  height: 60px;
  background: var(--bg-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.category-icon i {
  font-size: 24px;
  color: var(--primary-color);
  transition: all var(--transition-medium);
  position: relative;
  z-index: 1;
}

.category-item:hover .category-icon {
  background: var(--primary-light);
  transform: rotateY(180deg);
  box-shadow: var(--shadow-medium);
  border-color: rgba(255, 255, 255, 0.6);
}

.category-item:hover .category-icon i {
  color: white;
  transform: rotateY(-180deg);
}

.category-item.active .category-icon {
  background: white;
  box-shadow: var(--shadow-medium);
}

.category-item.active .category-icon i {
  color: var(--primary-color);
}

.category-item h3 {
  font-size: 17px;
  margin: 0;
  transition: color var(--transition-fast);
  font-weight: 700;
}

/* ===== SUBCATEGORIES SECTION ===== */
.subcategories-section {
  margin-bottom: 20px;
  position: relative;
  z-index: 40;
}

.subcategories-section h2,
.teachings-categories-section h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 29px;
  color: var(--text-light);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.topic-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.topic-btn {
  /* Inherits from .btn */
  color: var(--primary-dark);
  padding: 10px 15px;
  font-weight: bold;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  height: 45px;
}

/* .topic-btn::before, :hover, :hover::before are handled by .btn */

.topic-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-medium), inset 0 0 0 2px var(--primary-dark);
}

/* ===== VERSE DISPLAY SECTION ===== */
.verse-display-section {
  margin-top: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 30;
}

.verse-card {
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-medium), inset 0 0 0 1px var(--border-light);
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
  padding: 10px;
}

.verse-card:hover {
  box-shadow: var(--shadow-strong);
}

/* Card header responsive design */
.card-header {
  background: var(--primary-color);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 5;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 10px;
}

.category-label {
  font-weight: bold;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font-size: 18px;
}

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

.action-btn {
  /* Inherits from .btn */
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  font-size: 16px;
}

/* .action-btn:hover, :hover::before, :active are handled by .btn */

/* Copy feedback animation */
@keyframes copyFeedback {
  0%,
  100% {
    background: transparent;
  }
  50% {
    background: var(--success-color, #28a745);
  }
}

.copy-success {
  animation: copyFeedback 0.5s ease;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  margin-left: -100px;
  width: 200px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

#verse-content {
  padding: 20px;
  margin-top: 10px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  background: var(--card-bg);
  border-radius: 8px;
}

.verse-reference {
  font-size: 21px;
  color: var(--primary-dark);
  font-weight: bold;
  margin-bottom: 15px;
  font-family: var(--font-primary);
  position: relative;
  display: inline-block;
}

.verse-reference::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 50px;
  height: 2px;
  background-color: var(--primary-light);
}

.verse-text {
  font-size: 21px;
  line-height: 1.8;
  margin-bottom: 20px;
  position: relative;
  padding-left: 30px;
  border-left: 4px solid var(--primary-light);
  font-style: italic;
  color: var(--text-dark);
}

.teaching-title {
  font-size: 29px;
  color: var(--primary-dark);
  font-weight: bold;
  margin-bottom: 20px;
  font-family: var(--font-primary);
  position: relative;
  display: inline-block;
  line-height: 1.3;
}

.teaching-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 60px;
  height: 3px;
  background-color: var(--primary-light);
}

.teaching-text {
  font-size: 18px;
  line-height: 1.9;
  margin-bottom: 20px;
  margin-top: 25px;
  position: relative;
  color: var(--text-dark);
  text-align: justify;
  padding: 0px;
}

.topic-label {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 15px;
  display: inline-block;
  background-color: var(--bg-medium);
  padding: 5px 12px;
  border-radius: 20px;
  margin-top: 10px;
}

.search-result {
  margin-top: 15px;
  background-color: var(--bg-medium);
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-result i {
  font-size: 18px;
  color: var(--primary-color);
}

.card-footer {
  padding: 0;
  margin: 0;
  height: 0;
  min-height: 0;
  border-top: none;
  overflow: hidden;
}

#new-verse-btn {
  /* Inherits from .btn */
  color: var(--primary-color);
  padding: 10px 20px;
  font-weight: bold;
  display: inline-flex;
  gap: 8px;
  z-index: 10;
  pointer-events: auto !important;
}

/* #new-verse-btn:hover, :hover::before, :active are handled by .btn */

#new-verse-btn i {
  font-size: 13px;
}

/* Alternative fixed position for Next Verse button */
.fixed-button-container {
  position: absolute;
  top: 15px;
  right: 20px;
  z-index: 5;
}

/* Add style for primary and secondary categories */
.primary-category {
  font-weight: bold;
  color: var(--primary-dark);
}

.secondary-category {
  font-weight: normal;
  font-size: 14px;
  color: var(--primary-color);
  opacity: 0.8;
}

/* Improved tag and metadata styling */
.verse-metadata {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.tags-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tags-label {
  font-weight: bold;
  color: var(--primary-dark);
  font-size: 16px;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Unified tag styling - make category tags match life application tags */
.tag-pill {
  background: var(--card-bg);
  color: var(--primary-dark);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--border-light);
  position: relative;
  overflow: hidden;
}

.tag-pill:hover {
  background: var(--primary-light);
  color: white;
  box-shadow: var(--shadow-medium);
}

/* No Results Found styling - enhanced */
.no-results-container {
  text-align: center;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeIn 0.5s ease;
  border-radius: 0 0 15px 15px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.no-results-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.no-results-icon i {
  font-size: 32px;
  color: white;
  position: relative;
  z-index: 1;
}

.no-results-title {
  font-size: 29px;
  color: var(--primary-dark);
  margin-bottom: 5px;
  font-weight: 700;
}

.no-results-message {
  color: var(--text-medium);
  margin-bottom: 20px;
  font-size: 18px;
  max-width: 500px;
  line-height: 1.5;
  font-weight: normal;
}

.no-results-suggestions {
  background: var(--bg-medium);
  padding: 20px 25px;
  border-radius: 12px;
  text-align: left;
  max-width: 450px;
  margin: 0 auto;
  position: relative;
  border-left: 3px solid var(--primary-light);
  box-shadow: var(--shadow-soft);
}

.no-results-suggestions::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.no-results-suggestions p {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-dark);
  position: relative;
  z-index: 2;
}

.no-results-suggestions ul {
  padding-left: 20px;
  position: relative;
  z-index: 2;
}

.no-results-suggestions li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 5px;
  color: var(--text-medium);
  z-index: 2;
}

.no-results-suggestions li::marker {
  color: var(--primary-color);
}

.search-again-btn {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(110, 83, 151, 0.12);
  position: relative;
  overflow: hidden;
}

.search-again-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px 0 rgba(110, 83, 151, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* ===== FOOTER ===== */
.app-footer {
  background: var(--primary-dark);
  color: var(--text-light);
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.app-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.app-footer p {
  margin: 5px 0;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.app-footer i {
  color: var(--secondary-color);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Read All Section Styles */
.read-all-section {
  width: 100%;
  margin-top: 20px;
  display: none;
}

.read-all-section:not(.hidden) {
  display: block;
}

.read-all-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.read-all-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

.read-all-header h2 {
  font-size: 35px;
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.read-all-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  font-style: italic;
}

.teaching-item {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
  scroll-margin-top: 100px;
  transition: transform 0.3s ease;
  will-change: transform;
}

.teaching-item:last-child {
  margin-bottom: 0;
}

.teaching-item:hover {
  transform: translateY(-2px);
}

.teaching-item-title {
  font-size: 29px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

.teaching-item-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  border-radius: 12px;
}

.teaching-item-text {
  font-size: 18px;
  line-height: 1.9;
  color: var(--text-dark);
  text-align: justify;
  margin-bottom: 20px;
}

.teaching-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag-pill-small {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(110, 83, 151, 0.1);
  color: var(--primary-color);
  border-radius: 12px;
  font-size: 14px;
  font-weight: normal;
  transition: transform 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}

.tag-pill-small:hover {
  transform: translateY(-1px);
}

/* ===== TRANSLATION STYLES ===== */
.language-selector-container {
  position: relative;
  display: inline-block;
  margin-top: 20px;
  z-index: 1000;
}

.lang-toggle-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.lang-toggle-btn i {
  font-size: 18px;
}

.lang-dropdown {
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 280px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 1001;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.lang-option {
  padding: 12px 15px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-weight: 500;
  transition: background 0.2s ease;
}

.lang-option:hover {
  background: var(--bg-medium);
  color: var(--primary-color);
}

.lang-option.active {
  background: var(--primary-light);
  color: white;
}

/* Hide Google Translate Top Bar */
.goog-te-banner-frame.skiptranslate {
  display: none !important;
}

body {
  top: 0px !important;
  position: static !important;
}

/* Hide Google Tooltips and Highlights */
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
}

.goog-text-highlight {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  color: inherit !important;
}

/* Additional Hiding for Google Translate Artifacts */
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}

/* Hide the banner frame if it's an iframe */
iframe.goog-te-banner-frame {
  display: none !important;
}

/* Hide the top banner container often injected into the body */
body > .skiptranslate {
  display: none !important;
}

/* Ensure the page doesn't shift */
.goog-te-spinner-pos {
  display: none !important;
}

/* Neutralize Google Translate injected font tags */
font {
  background-color: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet and smaller devices */
@media (max-width: 768px) {
  /* Header adjustments */
  .app-header {
    padding: 30px 15px;
  }

  .app-header h1 {
    font-size: 35px;
  }

  .app-header p {
    font-size: 16px;
    padding: 0 10px;
  }

  .logo {
    width: 70px;
    height: 70px;
  }

  .logo i {
    font-size: 32px;
  }

  /* Content spacing */
  .app-content {
    padding: 15px;
  }

  /* Mode toggle buttons */
  .mode-toggle-container {
    flex-direction: column;
    gap: 12px;
  }

  .mode-toggle-btn {
    max-width: 100%;
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Search section */
  .search-container {
    padding: 8px;
  }

  .search-container input {
    font-size: 15px;
    padding: 12px 15px;
  }

  .search-container button {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  /* Categories grid */
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }

  .category-item {
    padding: 15px 8px;
  }

  .category-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
  }

  .category-icon i {
    font-size: 20px;
  }

  .category-item h3 {
    font-size: 15px;
  }

  /* Section headings */
  .categories-section h2,
  .subcategories-section h2,
  .teachings-categories-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  /* Topic tabs */
  .topic-tabs {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }

  .topic-btn {
    height: 42px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .app-content {
    padding: 10px;
  }

  .app-header {
    padding: 20px 15px;
  }

  .app-header h1 {
    font-size: 26px;
  }

  .app-header p {
    font-size: 15px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .topic-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .topic-btn {
    height: 38px;
    font-size: 13px;
    padding: 5px 8px;
  }

  .verse-text,
  .teaching-text {
    text-align: justify;
    font-size: 17px;
    line-height: 1.6;
  }

  .welcome-message {
    font-size: 16px;
  }

  .welcome-container {
    min-height: auto;
  }

  /* Read All Section Mobile Optimization */
  .read-all-container {
    padding: 0;
  }

  .read-all-header {
    padding: 15px;
    margin-bottom: 15px;
  }

  .read-all-header h2 {
    font-size: 24px;
  }

  .read-all-subtitle {
    font-size: 14px;
  }

  .teaching-item {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
  }

  .teaching-item-title {
    font-size: 21px;
    margin-bottom: 10px;
  }

  .teaching-item-text {
    font-size: 15px;
    line-height: 1.6;
    text-align: justify;
  }
}

@media (hover: none) and (pointer: coarse) {
  .category-item,
  .topic-btn,
  .mode-toggle-btn,
  .action-btn,
  #new-verse-btn,
  .search-container button {
    min-height: 44px;
  }
}
