* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', sans-serif;
  background: #0a0a0f;
  color: #fff;
  min-height: 100vh;
}

/* ===== SPLASH SCREEN ===== */
.splash-modern {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #581c87 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.splash-modern.fade-out {
  opacity: 0;
}

.splash-container {
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo-modern {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: logoFade 0.5s ease 0.2s forwards;
}

@keyframes logoFade {
  to {
    opacity: 1;
  }
}

.splash-title-modern {
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  opacity: 0;
  animation: titleFade 0.5s ease 0.4s forwards;
}

@keyframes titleFade {
  to {
    opacity: 1;
  }
}

.splash-loader {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 0 auto;
  overflow: hidden;
  opacity: 0;
  animation: loaderFade 0.5s ease 0.6s forwards;
}

@keyframes loaderFade {
  to {
    opacity: 1;
  }
}

.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 10px;
  animation: loaderSlide 1.2s ease infinite;
}

@keyframes loaderSlide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.auth-card-pro {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-header-pro {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-pro {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}

.auth-title-pro {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-subtitle-pro {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.auth-form-pro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input-pro {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.auth-input-pro::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-input-pro:focus {
  outline: none;
  border-color: #7c3aed;
  background: rgba(255, 255, 255, 0.08);
}

.auth-checkbox-pro {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.auth-checkbox-pro:hover {
  background: rgba(255, 255, 255, 0.03);
}

.auth-checkbox-pro.required {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.checkbox-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-top: 2px;
}

.checkbox-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

.terms-link {
  background: none;
  border: none;
  color: #7c3aed;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

.terms-link:hover {
  color: #a78bfa;
}

.auth-button-pro {
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  border: none;
  border-radius: 12px;
  padding: 1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.auth-button-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

.auth-toggle-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.auth-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.google-btn {
  background: #fff;
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  padding: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
  width: 100%;
}

.google-btn:hover {
  background: #f1f1f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.google-icon {
  width: 20px;
  height: 20px;
}

.auth-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

/* ===== MODAL TERMOS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-content {
  background: #1e1b4b;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.modal-scroll {
  overflow-y: auto;
  flex: 1;
  padding-right: 1rem;
  margin-bottom: 1.5rem;
}

.modal-scroll h3 {
  color: #a78bfa;
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.modal-scroll h3:first-child {
  margin-top: 0;
}

.modal-scroll p {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  font-size: 0.9rem;
}

.modal-button {
  background: #7c3aed;
  border: none;
  border-radius: 10px;
  padding: 0.875rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-button:hover {
  background: #6d28d9;
}

/* ===== LIBRARY SCREEN ===== */
.library-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0a0f 0%, #1a0f2e 100%);
  padding-bottom: 2rem;
}

.library-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.library-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.library-user h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.library-user p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.library-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.library-content {
  padding: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.library-loading,
.library-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.library-empty p:first-child {
  font-size: 4rem;
  margin-bottom: 1rem;
}

/* ===== BOOKS LIST ===== */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

/* Category Filters */
.category-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 1.5rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Loading States */
.library-loading-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.book-skeleton {
  height: 100px;
  width: 100%;
}

.book-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 58, 237, 0.5);
  transform: translateX(8px);
}

/* Glassmorphism Card */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Progress Ring (Circular Progress) */
.progress-ring {
  position: relative;
  width: 60px;
  height: 60px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: transparent;
  stroke-width: 4;
}

.progress-ring .background {
  stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring .bar {
  stroke: url(#grad-progress);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring .text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.book-cover {
  font-size: 3rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  border-radius: 12px;
  flex-shrink: 0;
}

.book-info {
  flex: 1;
}

.book-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #fff;
}

.book-item-author {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.25rem;
}

.book-item-steps {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.book-arrow {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.3s;
}

.book-item:hover .book-arrow {
  color: #7c3aed;
  transform: translateX(4px);
}

/* ===== READING SCREEN ===== */
.reading-screen-pro {
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0a0f 0%, #1a0f2e 100%);
  padding-bottom: 2rem;
}

.reading-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem;
}

.reading-header-pro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.reading-back,
.reading-sound {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.625rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reading-back:hover,
.reading-sound:hover {
  background: rgba(255, 255, 255, 0.1);
}

.reading-book-info {
  margin-bottom: 1rem;
}

.reading-book-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.reading-progress-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.reading-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 6px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.reading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.reading-content-pro {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.book-cover-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-item-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a78bfa;
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.reading-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
}

.reading-step-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
}

.reading-reflection {
  background: rgba(124, 58, 237, 0.1);
  border-left: 4px solid #7c3aed;
  border-radius: 12px;
  padding: 1.25rem;
}

.reflection-label {
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.reflection-text {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  font-size: 0.95rem;
}

.reading-complete-btn {
  width: 100%;
  background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
  border: none;
  border-radius: 14px;
  padding: 1.125rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.reading-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .auth-card-pro {
    padding: 2rem 1.5rem;
  }

  .library-header {
    padding: 1rem;
  }

  .library-content {
    padding: 1rem;
  }

  .book-item {
    padding: 1rem;
  }

  .book-cover {
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
  }

  .reading-content-pro {
    padding: 1.5rem;
  }
}