/* Media query pentru max-width: 1024px */
@media (max-width: 1024px) {
  /* Afi?eaza butonul de meniu mobil */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  
  .book-details-modal-content {
            max-width: 50%;
        padding: 20px;
        margin: 10px;
        left: 257px;
    }  
  .book-details-modal {
            margin: 0;
        padding: 20px;
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        overflow-y: auto;
    }
  
 
    .container {
        grid-template-columns: 1fr;
        gap: 11px;
        margin-top: -13px;
    }
  /* SEARCH CONTAINER - compact īn header */
  .search-container {
    flex: 1;
    max-width: 200px;
    margin-right: 15px;
right: -70px;
  }

/* BUTON HAMBURGER - pozi?ie fixa sus stānga */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 44px;
    left: 55px;
    z-index: 1001;
    background: var(--secondary-gradient);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
  }


  .sidebar, .right-sidebar {
    display: none;
  }
  
  /* Sidebar ca overlay pe mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    border-radius: 0 20px 20px 0;
    display: block !important;
  }
  
  .sidebar.open {
    left: 0;
  }
}

/* RESETARE COMPLETA PENTRU MOBILE */
@media (max-width: 768px) {
  /* Reset body ?i html pentru mobile */
  body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--bg-primary);
  }
  
  /* BUTON HAMBURGER - pozi?ie fixa sus stānga */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: var(--secondary-gradient);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
  }
  
  /* CONTAINER PRINCIPAL - full width, fara margini */
  .container {
    display: block; /* Nu mai grid */
    width: 99vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
  }
  
  /* ASCUNDE SIDEBAR-URILE COMPLET */
  .sidebar, .right-sidebar {
    display: none;
  }
  
  /* MAIN CONTENT - full width */
  .main {
    width: 99%;
    padding: 0;
    margin: 0;
  }
  
  /* HEADER MOBIL - fix la top, compact */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 70px 0 20px; /* Spa?iu pentru hamburger */
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  }
  
  /* SEARCH CONTAINER - compact īn header */
  .search-container {
    flex: 1;
    max-width: 180px;
    margin-right: 15px;
right: -50px;
  }
  
  .search-container input {
    width: 100%;
    height: 35px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
  }
  
  /* NAV RIGHT - compact */
  .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
 .member-points {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--secondary-gradient);
    color: white;
    white-space: nowrap;
    position: absolute; /* Adaugat! */
    right: 70px;
}
  
  .user-avatar-wrapper {
    width: 35px;
    height: 35px;
  }
  
 
    .user-avatar {
        position: absolute;
        right: 10px;
        top: 10px; /* ajusteaza dupa nevoie */
    }

      .profile {
        padding: 8px 15px;
        font-size: 14px;
    }
 /* PROFILE DROPDOWN - afi?at pe mobile */
.profile-dropdown {
  display: block;
  position: relative;
}

.profile {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--secondary-gradient);
  border-radius: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: auto;
}

.profile i {
  font-size: 16px;
}

.profile span {
  display: none; /* Ascunde textul pe mobile pentru a economisi spa?iu */
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-heavy);
  min-width: 180px;
  z-index: 1000;
  display: none;
}

.profile-menu.show {
  display: block;
  animation: slideInDown 0.3s ease;
}

.profile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-size: 14px;
}

.profile-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-menu a:first-child {
  border-radius: 12px 12px 0 0;
}

.profile-menu a:last-child {
  border-radius: 0 0 12px 12px;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}  /* CONTENT PRINCIPAL - īncepe dupa header */
   .content {
        margin-top: 80px;
        padding: 0;
        width: 98%;
        margin-left: -10px; /*  mpinge spre st nga */
    }  
  /* MOBILE SIDEBAR CONTENT - la īnceput */
  .mobile-sidebar-content {
    display: block;
    padding: 15px;
    background: var(--bg-primary);
  }
  
  .mobile-section {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .mobile-section h4 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  /* TOP FANTEZII - grid frumos */
  .mobile-fantasies-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .mobile-fantasy-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .mobile-fantasy-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  }
  
  .fantasy-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--secondary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
  }
  
  .fantasy-info {
    flex: 1;
  }
  
  .fantasy-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  
  .fantasy-author {
    font-size: 12px;
    color: var(--text-secondary);
  }
  
  /* ULTIMELE CAR?I - grid 3 coloane */
  .mobile-books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .mobile-book-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .mobile-book-item:hover {
    transform: translateY(-5px);
  }
  
  .mobile-book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    position: relative;
  }
  
  .mobile-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
  
  .mobile-book-item:hover .mobile-book-cover img {
    transform: scale(1.05);
  }
  
  .mobile-book-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
  }
  
  .mobile-book-author {
    font-size: 10px;
    color: var(--text-secondary);
  }
  
  /* SECTION CONTAINERS - full width, fara margini */
  .section-container {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .section-container h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  /* TAB BUTTONS - scroll orizontal */
  .tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tab-buttons::-webkit-scrollbar {
    display: none;
  }
  
  .tab-button {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    min-width: fit-content;
    border-radius: 25px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .tab-button.active {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,157,0.4);
  }
  
  /* CATEGORY FILTERS - scroll orizontal */
  .tags {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tags::-webkit-scrollbar {
    display: none;
  }
  
  .category-filter {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    min-width: fit-content;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
  }
  
  .category-filter.active {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(255,107,157,0.4);
  }
  
  /* BOOKS GRID - 2 coloane pe mobile */
  .category-books-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  /* BOOK ITEMS - mai mari ?i mai frumoase */
  .book {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
  }
  
  .book:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }
  
  .book img {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  }
  
  .book p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
  }
  
  .book-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    z-index: 2;
  }
  
  /* BOOK LIST WRAPPER - scroll orizontal īmbunata?it */
  .book-list-wrapper {
    position: relative;
    margin: 0 -10px;
  }
  
  .book-list {
    overflow-x: auto;
    padding: 0 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .book-list::-webkit-scrollbar {
    display: none;
  }
  
  .book-scroll-container {
    display: flex;
    gap: 15px;
    padding: 10px 0;
  }
  
  .book-scroll-container .book {
    min-width: 140px;
    flex-shrink: 0;
  }
  
  /* NAV ARROWS - mai mici pe mobile */
  .nav-arrow {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }
  
  /* MODALELE - full screen pe mobile */
  .fantasy-modal-content,
  .book-details-modal-content {
            margin: 0;
        padding: 20px;
        width: 83vw;
        height: 107vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        overflow-y: auto;
        left: 22px;
    }  
  /* RATING STARS */
  .rating-stars {
    margin-top: 5px;
    display: flex;
    justify-content: center;
    gap: 2px;
  }
  
  .star {
    font-size: 12px;
    color: #ddd;
  }
  
  .star.filled {
    color: #ffd700;
  }
  
  /* SUBSCRIPTION MODAL */
  .subscription-plans {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .subscription-modal-content {
    padding: 20px;
    margin: 20px;
  }
}

/* MOBILE FOARTE MIC */
@media (max-width: 480px) {
  .mobile-books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .category-books-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .section-container {
    margin: 10px;
    padding: 15px;
  }
  
  .mobile-section {
    padding: 15px;
  }
}

/* Ascunde con?inutul mobile pe desktop */
.mobile-sidebar-content {
  display: none;
}

/* Tab-uri Premium ?i VIP */
.tab-button.premium-tab {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  border: 2px solid #ffd700;
}

.tab-button.premium-tab:hover,
.tab-button.premium-tab.active {
  background: linear-gradient(135deg, #ffed4e, #ffd700);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.tab-button.vip-tab {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: white;
  border: 2px solid #9333ea;
}

.tab-button.vip-tab:hover,
.tab-button.vip-tab.active {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
}

/* Badge-uri colorate */
.book-badge.free {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
}

.book-badge.premium {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
  font-weight: bold;
}

.book-badge.vip {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: white;
  font-weight: bold;
}

/* Mesaje de abonament */
.subscription-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  min-height: 300px;
}

.subscription-message i {
  font-size: 4rem;
  margin-bottom: 20px;
}

.premium-message i {
  color: #ffd700;
}

.vip-message i {
  color: #9333ea;
}

.subscription-message h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #333;
}

.subscription-message p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 25px;
  max-width: 400px;
}

.upgrade-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.upgrade-btn.premium-btn {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
}

.upgrade-btn.premium-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.upgrade-btn.vip-btn {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: white;
}

.upgrade-btn.vip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(147, 51, 234, 0.4);
}

/* Overlay pentru car?ile restric?ionate */
.book.restricted::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
}

.book.restricted.premium::after {
  content: "Premium\ARequis";
  background: rgba(255, 215, 0, 0.9);
  color: #333;
}

.book.restricted.vip::after {
  content: "VIP\ARequis";
  background: rgba(147, 51, 234, 0.9);
  color: white;
}

/* Badge-uri pentru categorii */
.book {
    position: relative;
}

.book-badge.category {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

.book-badge.subscription {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

/* Mesaje de upgrade īn modal */
.upgrade-message {
    text-align: center;
    padding: 30px 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.upgrade-message.premium {
    background: linear-gradient(135deg, #fff7e6, #ffeaa7);
    border: 2px solid #ffd700;
}

.upgrade-message.vip {
    background: linear-gradient(135deg, #f3e8ff, #e1bee7);
    border: 2px solid #9333ea;
}

.upgrade-message i {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.upgrade-message.premium i {
    color: #ffd700;
}

.upgrade-message.vip i {
    color: #9333ea;
}

.upgrade-message h4 {
    margin: 10px 0;
    font-size: 1.2rem;
}

.upgrade-message p {
    margin: 15px 0;
    color: #666;
}

/* Badge-uri colorate pentru tipuri de abonament */
.book-badge.free {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.book-badge.premium {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.book-badge.vip {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
}