@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* Enable selection in search inputs and text fields so user typing and editing remains fully functional */
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

:root {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;

  color: #e2e8f0;
  background: radial-gradient(circle at top right, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  background-attachment: fixed;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Light Theme: Override dark :root gradient on both html and body elements */
html.light-theme,
html.light-theme body,
body.light-theme {
  background: #ffffff !important;
  background-attachment: initial !important;
  color: #0f172a !important;
}

.app-container {
  width: 95%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 20px 10px;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  animation: fadeIn 0.8s ease-out;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
}

.brand-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, #ffffff 30%, #cbd5e1 70%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.tagline {
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 300;
  margin-top: 5px;
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .app-container {
    padding: 20px;
  }
}

/* Glass Cards */
.panel {
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
}

.panel-title i {
  color: #818cf8;
}

/* Config & Launcher styles */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.85);
}

.btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 25px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.divider:not(:empty)::before {
  margin-right: .5em;
}

.divider:not(:empty)::after {
  margin-left: .5em;
}

/* Offline Bookshelf Styles */
.bookshelf-container {
  max-height: 650px;
  overflow-y: auto;
  padding-right: 5px;
}

.bookshelf-container::-webkit-scrollbar {
  width: 6px;
}

.bookshelf-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.bookshelf-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.bookshelf-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.book-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.book-card:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateX(4px);
}

.book-cover-mini {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  background: #1e293b;
}

.book-info {
  flex: 1;
}

.book-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f1f5f9;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.book-author-meta {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.epub {
  background: rgba(217, 70, 239, 0.15);
  color: #f5d0fe;
}

.badge.pdf {
  background: rgba(244, 63, 94, 0.15);
  color: #fecdd3;
}

.book-action-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.book-card:hover .book-action-btn {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.8rem;
  color: #475569;
}

footer a {
  color: #6366f1;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Status message */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 15px;
}

.status-bar.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
}

/* --- Premium Sidebar Filters System --- */
.library-layout-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 20px;
  width: 100%;
}

.horizontal-filters-panel {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.horizontal-filters-header {
  color: #3b82f6;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  margin-bottom: 5px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.categories-row {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.categories-row .filter-section-title {
  margin-bottom: 0;
  flex-shrink: 0;
  min-width: 90px;
}

.category-pills-scroll-wrapper {
  flex: 1;
  overflow-x: auto;
  overscroll-behavior-x: contain; /* Prevents main page from scrolling while scrolling horizontally */
  scrollbar-width: none; /* Firefox */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch; /* Smooth inertia scrolling on iOS */
  touch-action: pan-x; /* Limits touch scrolling strictly to the horizontal axis */
}

.category-pills-scroll-wrapper::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.category-pills-container {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 6px 2px;
}

.filter-section-title {
  color: #64748b;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Very thin modern border */
  color: #94a3b8; /* Simple gray text */
  padding: 10px 22px; /* Generous and stylish padding */
  border-radius: 99px; /* Fully rounded pill */
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.filter-pill.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.65), 0 4px 12px rgba(59, 130, 246, 0.35); /* Neon blue glow effect */
  font-weight: 600;
}

.dropdowns-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 15px;
}

.dropdown-group {
  flex: 1;
  min-width: 180px;
}

.filter-select {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.3s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: none !important; /* Ok isaretleri kaldirildi */
  padding-right: 16px !important;
  text-overflow: ellipsis;
}

.filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.85);
}

.filter-actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  height: 44px;
}

.btn-reset-filters {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 20px;
  padding: 10px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-reset-filters:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* Light Theme Styling for Horizontal Filters */
body.light-theme .horizontal-filters-panel {
  background: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .horizontal-filters-header {
  color: #4f46e5 !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .filter-section-title {
  color: #64748b !important;
}

body.light-theme .filter-pill {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #475569 !important;
  border-radius: 99px !important;
}

body.light-theme .filter-pill:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

body.light-theme .filter-pill.active {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.5), 0 4px 10px rgba(79, 70, 229, 0.25) !important;
}

body.light-theme .filter-select {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
  background-image: none !important;
}

body.light-theme .filter-select:focus {
  border-color: #4f46e5 !important;
  background: #ffffff !important;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.1) !important;
}

body.light-theme .btn-reset-filters {
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #475569 !important;
}

body.light-theme .btn-reset-filters:hover {
  border-color: #dc2626 !important;
  color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.05) !important;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .horizontal-filters-panel {
    padding: 15px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }
  
  .categories-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  
  .categories-row .filter-section-title {
    min-width: auto;
  }
  
  .dropdowns-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }
  
  .dropdown-group {
    width: 100%;
  }
  
  .filter-actions-group {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  
  .btn-reset-filters {
    width: 100%;
    text-align: center;
  }
}

/* --- Interactive Element Onboarding Tour System --- */
.br-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.br-tour-overlay.active {
  pointer-events: auto;
  opacity: 1;
}

.br-tour-spotlight {
  position: absolute;
  border: 2px solid #818cf8;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.78), 0 0 20px rgba(129, 140, 248, 0.4);
  z-index: 15001;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.br-tour-popover {
  position: absolute;
  width: 330px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.1);
  z-index: 15002;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  text-align: left;
}

.br-tour-popover.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.br-tour-popover-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
}

.br-tour-popover-text {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.br-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 15px;
}

.br-tour-progress {
  font-size: 0.75rem;
  color: #818cf8;
  font-weight: 600;
}

.br-tour-buttons {
  display: flex;
  gap: 8px;
}

.br-tour-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.br-tour-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.br-tour-btn.primary {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.br-tour-btn.primary:hover {
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.br-tour-btn.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}

.br-tour-btn.close-btn:hover {
  color: #fff;
}

/* Light Theme overrides for Tour components */
body.light-theme .br-tour-spotlight {
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.65), 0 0 20px rgba(99, 102, 241, 0.3);
}

body.light-theme .br-tour-popover {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), 0 0 20px rgba(99, 102, 241, 0.05) !important;
}

body.light-theme .br-tour-popover-title {
  color: #0f172a !important;
}

body.light-theme .br-tour-popover-text {
  color: #475569 !important;
}

body.light-theme .br-tour-btn {
  color: #475569 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .br-tour-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

body.light-theme .br-tour-btn.primary {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #fff !important;
}

body.light-theme .br-tour-btn.primary:hover {
  background: #4f46e5 !important;
}

body.light-theme .br-tour-footer {
  border-top-color: rgba(0, 0, 0, 0.06) !important;
}

/* Mobile and Tablet responsive tour sizing and optimization */
@media (max-width: 1024px) {
  .br-tour-popover {
    width: calc(100% - 30px) !important;
    max-width: 340px !important;
    padding: 16px 20px !important;
  }
  .br-tour-popover-title {
    font-size: 0.95rem !important;
    margin-bottom: 4px !important;
  }
  .br-tour-popover-text {
    font-size: 0.8rem !important;
    margin-bottom: 12px !important;
    line-height: 1.45 !important;
  }
  .br-tour-footer {
    padding-top: 10px !important;
  }
  .br-tour-btn {
    padding: 5px 12px !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
  }
}

