* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden; /* Chỉ ẩn thanh cuộn ngang, cho phép cuộn dọc */
    font-family: Arial, sans-serif;
}

.cosmos-background {
    position: fixed;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0c164d 0%, #0a0e2e 50%, #05051a 100%);
    overflow: hidden;
    z-index: -2;
}

.nebula {
    position: absolute;
    border-radius: 50%;
}

.nebula-1 {
    width: 600px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(102, 26, 176, 0.56) 0%, rgba(102, 26, 176, 0) 100%);
    top: 10%;
    left: 10%;
    filter: blur(30px);
    animation: float 120s infinite alternate;
}

.nebula-2 {
    width: 500px;
    height: 400px;
    background: radial-gradient(circle at center, rgba(78, 110, 242, 0.5) 0%, rgba(78, 110, 242, 0) 100%);
    top: 40%;
    left: 50%;
    filter: blur(30px);
    animation: float2 150s infinite alternate;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, 20px) rotate(5deg); }
}

@keyframes float2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, 10px) rotate(-5deg); }
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
}

.main-container {
    position: relative;
    width: 80%;
    max-width: 900px;
    min-height: 600px;
    background-color: rgba(5, 5, 26, 0.7);
    border: 1px solid #6366f1;
    border-radius: 10px;
    margin: 50px auto;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.header {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-title {
    flex: 1;
}

.search-container {
    position: relative;
    margin-left: 20px;
}

.search-input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #6366f1;
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: #e2e8f0;
    font-size: 14px;
    width: 180px;
    transition: all 0.3s ease;
}

.search-input:focus {
    width: 220px;
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6366f1;
    font-size: 14px;
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #6366f1;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
}

.search-results.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.search-result-item {
    display: block;
    padding: 10px 15px;
    color: #e2e8f0;
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    text-align: left;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #f8fafc;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 14px;
}

.search-result-content {
    font-size: 12px;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-highlight {
    background: rgba(99, 102, 241, 0.3);
    padding: 0 2px;
    border-radius: 3px;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #cbd5e1;
    font-style: italic;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile header layout: stack title+slogan above, search below */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .header-title {
    width: 100%;
    text-align: left;
  }
  .search-container {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
  }
  .search-input {
    width: 100%;
  }
  .search-input:focus {
    width: 100%;
  }
  .search-results {
    left: 0;
    right: auto;
    width: 100%;
  }
}

h1 {
    color: #f8fafc;
    margin-bottom: 5px;
    font-size: 28px;
}
.header-title h1 a {
    color: inherit;
    text-decoration: none;
}

.subtitle {
    color: #cbd5e1;
    font-style: italic;
    font-size: 16px;
    margin-bottom: 20px;
}

.divider {
    border-top: 1px solid rgba(99, 102, 241, 0.7);
    margin: 20px 0;
}

.books-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 40px;
    gap: 30px;
}

.book {
    width: 240px;
    height: 320px;
    position: relative;
    cursor: pointer;
    margin-bottom: 20px;
    transform: perspective(1200px) rotateY(5deg);
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.book:hover {
    transform: perspective(1200px) rotateY(-15deg) translateY(-10px);
}

.book-front {
    position: absolute;
    width: 240px;
    height: 320px;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.6));
    border-radius: 5px;
    box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateZ(10px);
}

.book-spine {
    position: absolute;
    width: 25px;
    height: 320px;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.8), rgba(8, 12, 24, 0.9));
    transform: translateX(240px) rotateY(90deg);
    transform-origin: 0% 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0 2px 2px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.book-side {
    position: absolute;
    width: 200px;
    height: 25px;
    background: #f8fafc;
    transform: translateY(150px) rotateX(-90deg);
    transform-origin: 0 0;
    background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e1 100%);
    display: none;
}

.book-pages {
    position: absolute;
    width: 230px;
    height: 310px;
    background: #f8fafc;
    transform: translateX(15px) translateY(5px) translateZ(9px);
    border-radius: 4px 0 0 4px;
    box-shadow: inset -3px 0 10px rgba(0, 0, 0, 0.1);
}

.book-pages::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 0.03) 0px, 
        transparent 1px, 
        transparent 3px, 
        rgba(0, 0, 0, 0.02) 4px, 
        transparent 5px);
    background-size: 5px 100%;
}

.book-bottom {
    display: none;
}

.book-cover {
    width: 100%;
    height: 230px;
    margin-bottom: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
}

.book-1 .book-front {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #2e1065 100%);
}

.book-1 .book-spine {
    background: linear-gradient(to right, #0a0f1a, #1e1b4b);
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3) inset;
}

.book-2 .book-front {
    background: linear-gradient(135deg, #082f49 0%, #1e3a8a 50%, #3b0764 100%);
}

.book-2 .book-spine {
    background: linear-gradient(to right, #041e31, #1e3a8a);
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.3) inset;
}

.book-title {
    color: #f8fafc;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 0 15px;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    position: relative;
    width: 85%;
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.book-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.book-emboss {
    display: none;
}

.footer {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    color: #cbd5e1;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(99, 102, 241, 0) 0%, 
        rgba(165, 180, 252, 0.5) 50%,
        rgba(99, 102, 241, 0) 100%);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding-bottom: 20px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    text-align: left;
}

@media (max-width: 600px) {
    .footer-content {
        gap: 15px;
        flex-wrap: nowrap; /* Buộc 2 cột luôn nằm cùng hàng */
    }
    .footer-section {
        min-width: 0; /* Loại bỏ min-width để flex-shrink hoạt động */
        flex: 1;
    }
    .footer-title {
        font-size: 15px;
    }
    .footer-section p {
        font-size: 13px;
    }
    .footer-links a {
        font-size: 13px;
    }
}

.footer-title {
    font-size: 16px;
    font-weight: bold;
    color: #e2e8f0;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, transparent);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.footer-links a::before {
    content: '•';
    color: #6366f1;
    margin-right: 8px;
    font-size: 14px;
}

.footer-links a:hover {
    color: #a5b4fc;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-3px);
}

.social-icon i {
    color: #e2e8f0;
    font-size: 16px;
}

.copyright {
    padding: 15px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
}

.copyright a {
    color: #a5b4fc;
    text-decoration: none;
}

.cosmic-rays {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(99, 102, 241, 0) 0%, 
        rgba(165, 180, 252, 0.3) 30%,
        rgba(139, 92, 246, 0.5) 50%,
        rgba(165, 180, 252, 0.3) 70%,
        rgba(99, 102, 241, 0) 100%);
    box-shadow: 0 0 10px #a5b4fc;
}

/* Thiên hà */
.galaxy {
    width: 160px;
    height: 160px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-galaxy 120s linear infinite;
    margin-top: 25px;
    perspective: 1000px;
    transform: perspective(1000px) rotateX(20deg);
}

@keyframes rotate-galaxy {
    0% { transform: perspective(1000px) rotateX(20deg) rotateZ(0deg); }
    100% { transform: perspective(1000px) rotateX(20deg) rotateZ(360deg); }
}

.galaxy-core {
    position: absolute;
    width: 72px;
    height: 72px;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 250, 240, 0.95) 5%,
        rgba(255, 236, 210, 0.9) 10%,
        rgba(254, 215, 170, 0.8) 20%,
        rgba(251, 191, 36, 0.7) 30%,
        rgba(217, 119, 6, 0.5) 40%,
        rgba(180, 83, 9, 0.3) 50%,
        rgba(120, 53, 15, 0.1) 70%,
        rgba(0, 0, 0, 0) 80%
    );
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 28px rgba(255, 255, 255, 0.9),
        0 0 45px rgba(251, 191, 36, 0.6),
        0 0 60px rgba(217, 119, 6, 0.4);
    z-index: 4;
    filter: blur(1px);
}

.spiral {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
}

.spiral-arm1, .spiral-arm2 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160%;
    height: 160%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(15, 23, 42, 0) 0%,
        rgba(30, 64, 175, 0.2) 10%, 
        rgba(56, 189, 248, 0.3) 20%,
        rgba(147, 51, 234, 0.5) 30%,
        rgba(79, 70, 229, 0.8) 40%,
        rgba(59, 130, 246, 0.6) 50%,
        rgba(129, 140, 248, 0.3) 60%,
        rgba(165, 180, 252, 0.2) 70%,
        rgba(15, 23, 42, 0) 80%
    );
    transform-origin: center;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(2px);
    clip-path: url(#spiral-clip);
    opacity: 0.8;
    mix-blend-mode: screen;
}

.spiral-arm2 {
    transform: translate(-50%, -50%) scale(1) rotate(180deg);
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(15, 23, 42, 0) 0%,
        rgba(244, 114, 182, 0.2) 10%, 
        rgba(249, 168, 212, 0.3) 20%,
        rgba(217, 70, 239, 0.5) 30%,
        rgba(168, 85, 247, 0.8) 40%,
        rgba(139, 92, 246, 0.6) 50%,
        rgba(196, 181, 253, 0.3) 60%,
        rgba(228, 228, 231, 0.2) 70%,
        rgba(15, 23, 42, 0) 80%
    );
    clip-path: url(#spiral-clip2);
    opacity: 0.7;
}

.galaxy-dust {
    position: absolute;
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.5) 0%, rgba(139, 92, 246, 0) 35%),
        radial-gradient(ellipse at 70% 60%, rgba(59, 130, 246, 0.5) 0%, rgba(59, 130, 246, 0) 40%),
        radial-gradient(ellipse at 40% 70%, rgba(168, 85, 247, 0.4) 0%, rgba(168, 85, 247, 0) 30%),
        radial-gradient(ellipse at 65% 25%, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0) 25%);
    z-index: 1;
    opacity: 0.7;
    mix-blend-mode: screen;
    filter: blur(3px);
    animation: dust-float 60s ease-in-out infinite alternate;
}

@keyframes dust-float {
    0% { transform: translateX(-5px) translateY(5px) rotate(-2deg); }
    100% { transform: translateX(5px) translateY(-5px) rotate(2deg); }
}

.galaxy-stars {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(1px 1px at 10% 10%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 15% 15%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 20% 20%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 25% 25%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 30% 30%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 35% 35%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 40% 40%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 45% 45%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 50% 50%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 55% 55%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 60% 60%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 65% 65%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 70% 70%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 75% 75%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 80% 80%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 85% 85%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 90% 90%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 95% 95%, white 100%, transparent 100%);
    z-index: 3;
    opacity: 0.8;
}

.galaxy-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180%;
    height: 180%;
    background: radial-gradient(
        ellipse at center,
        rgba(30, 64, 175, 0.3) 0%,
        rgba(15, 23, 42, 0) 70%
    );
    transform: translate(-50%, -50%);
    filter: blur(10px);
    z-index: 0;
    opacity: 0.8;
    border-radius: 50%;
    mix-blend-mode: screen;
}

/* Hành tinh trong galaxy */
.gx-planet {
    position: absolute;
    border-radius: 50%;
    z-index: 6;
}

/* Hành tinh cam – góc trên trái */
.gx-p1 {
    width: 20px;
    height: 20px;
    top: 10px;
    left: 12px;
    background: radial-gradient(circle at 33% 28%,
        #fde68a 0%,
        #f59e0b 25%,
        #c88b3a 55%,
        #92400e 80%,
        #78350f 100%);
    box-shadow:
        0 0 8px rgba(200, 139, 58, 0.8),
        0 0 16px rgba(200, 139, 58, 0.4);
}

/* Hành tinh vàng – góc phải */
.gx-p2 {
    width: 16px;
    height: 16px;
    top: 22px;
    left: 108px;
    background: radial-gradient(circle at 33% 28%,
        #fefce8 0%,
        #fef08a 20%,
        #d4af7a 55%,
        #b8860b 100%);
    box-shadow:
        0 0 8px rgba(212, 175, 122, 0.8),
        0 0 16px rgba(212, 175, 122, 0.4);
}

/* Hành tinh xanh – góc dưới phải */
.gx-p3 {
    width: 14px;
    height: 14px;
    top: 105px;
    left: 95px;
    background: radial-gradient(circle at 33% 28%,
        #bfdbfe 0%,
        #60a5fa 30%,
        #2563eb 65%,
        #1e3a8a 100%);
    box-shadow:
        0 0 8px rgba(37, 99, 235, 0.9),
        0 0 16px rgba(37, 99, 235, 0.5);
}

/* Quả địa cầu */
.globe {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        #3b82f6 0%, 
        #2563eb 30%, 
        #1d4ed8 60%, 
        #1e40af 80%, 
        #1e3a8a 100%);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
    position: relative;
    overflow: hidden;
    margin-top: 30px;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Lưới kinh vĩ tuyến - đứng yên */
.globe-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='140' height='140' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(219, 234, 254, 0.35)' stroke-width='0.6'%3E%3Cpath d='M70,140 Q0,70 70,0 Q140,70 70,140 Z' /%3E%3Cpath d='M70,140 Q20,70 70,0 Q120,70 70,140 Z' /%3E%3Cpath d='M70,140 Q40,70 70,0 Q100,70 70,140 Z' /%3E%3Cpath d='M0,35 L140,35' /%3E%3Cpath d='M0,70 L140,70' /%3E%3Cpath d='M0,105 L140,105' /%3E%3C/g%3E%3C/svg%3E") no-repeat center;
    background-size: 140px 140px;
    z-index: 3;
    pointer-events: none;
}

/* Bề mặt trái đất - xoay theo trục đứng */
.globe-surface {
    position: absolute;
    width: 200%;
    height: 100%;
    top: 0;
    left: 0;
    background: url("data:image/svg+xml,%3Csvg width='140' height='140' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='rgba(29, 78, 216, 0.45)'%3E%3Cpath d='M15,20 Q35,5 55,25 Q68,45 55,65 Q40,75 22,62 Q8,45 15,20Z'/%3E%3Cpath d='M80,15 Q100,8 118,28 Q128,50 115,68 Q98,78 82,65 Q72,50 80,15Z'/%3E%3Cpath d='M30,85 Q50,75 68,88 Q75,105 65,122 Q48,132 32,118 Q22,100 30,85Z'/%3E%3Cpath d='M100,90 Q115,82 128,98 Q132,115 118,125 Q105,128 96,115 Q92,100 100,90Z'/%3E%3C/g%3E%3C/svg%3E") repeat-x center;
    background-size: 140px 140px;
    z-index: 1;
    animation: rotate-globe 20s linear infinite;
}

@keyframes rotate-globe {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Xóa ::before (không còn dùng cho lưới) */
.globe::before {
    display: none;
}

.globe::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 100%);
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
}

.globe-glow {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 80%);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 2;
}

.globe-orbit {
    position: absolute;
    width: 170px;
    height: 50px;
    border: 1px solid rgba(219, 234, 254, 0.4);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    z-index: 1;
}

.globe-satellite {
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
    z-index: 2;
    animation: orbit 15s linear infinite;
}

@keyframes orbit {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(70px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(70px) rotate(-360deg); }
}

.globe-clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image:
        radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 15%),
        radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 10%),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 12%);
    filter: blur(2px);
    opacity: 0.7;
    animation: cloud-move 40s linear infinite;
    z-index: 4;
}

@keyframes cloud-move {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Media query for mobile spacing moved to bottom to ensure it overrides everything else */


/* CSS for detail page */
.header {
    margin-bottom: 15px; /* Giảm margin dưới header (từ 30px xuống 15px) */
}

/* CSS mặc định cho trang chủ */
.main-container {
    position: relative;
    width: 80%;
    max-width: 900px;
    min-height: 600px;
    background-color: rgba(5, 5, 26, 0.7);
    border: 1px solid #6366f1;
    border-radius: 10px;
    margin: 50px auto;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

/* CSS đặc biệt chỉ áp dụng cho trang chi tiết */
.detail-page .main-container {
    width: 95%; /* Tăng từ 80% lên 95% */
    max-width: none; /* Bỏ giới hạn max-width 900px */
}

.book-detail {
    padding: 10px 30px 20px; /* Giảm padding trên từ 20px xuống 10px */
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.book-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px; /* Giảm margin dưới (từ 20px xuống 15px) */
}

.book-icon {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.book-info {
    text-align: left;
}

.book-info h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #f8fafc;
}

.book-info h2 a {
    text-decoration: none;
    color: inherit;
}

.content-container {
    display: flex;
    gap: 30px;
    flex-grow: 1;
    margin-bottom: 15px;
}

.table-of-contents {
    width: 280px; /* Tăng chiều rộng từ 250px lên 280px */
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    height: 500px;
    position: sticky;
    top: 30px;
}

.toc-title {
    font-size: 16px;
    font-weight: bold;
    color: #f8fafc;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.4);
    position: relative;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.9);
    z-index: 10;
}

.toc-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, transparent);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-chapter {
    display: block;
    color: #e2e8f0;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 3px;
    cursor: pointer;
    position: relative;
}

.toc-chapter:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #f8fafc;
}

.toc-chapter.active {
    background: rgba(99, 102, 241, 0.3);
    color: #f8fafc;
    font-weight: bold;
}

.toc-chapter.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #6366f1;
    border-radius: 3px;
}

.toc-section {
    padding-left: 15px;
}

.toc-section .toc-chapter {
    font-size: 14px;
    padding: 5px 8px;
}

.chapter-content {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 8px;
    padding: 25px 30px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    position: relative;
    max-height: 700px;
    font-size: 16px; /* Thêm kích thước font phù hợp với màn hình rộng */
    /*line-height: 1.8;*/
}

.chapter {
    display: none;
    text-align: left;
    /*line-height: 1.8;*/
}

.chapter.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chapter h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #f8fafc;
    position: relative;
    padding-bottom: 10px;
}

.chapter h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, transparent);
}

.chapter h4 {
    font-size: 20px;
    margin: 25px 0 15px;
    color: #e2e8f0;
}

.chapter p {
    margin-bottom: 15px;
}

.reading-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a5b4fc);
    z-index: 10;
    transition: width 0.2s ease;
}


.nav-button {
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
    border: 1px solid #6366f1;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
    font-size: 14px;
}

.nav-button:hover {
    background: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.back-button {
    display: inline-block;
    padding: 8px 15px;
    margin-top: 20px;
    background: rgba(99, 102, 241, 0.2);
    color: #e2e8f0;
    border: 1px solid #6366f1;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(99, 102, 241, 0.4);
}

/* Media queries for detail page */
@media (max-width: 768px) {
    .book-detail {
        padding: 15px;
    }
    
    .content-container {
        flex-direction: column;
    }
    
    .table-of-contents {
        width: 100%;
        margin-bottom: 15px;
        height: 300px;
        position: relative;
        top: 0;
    }
    
    .chapter-content {
        max-height: 450px;
    }
}

/* Thêm media query cho màn hình rất lớn */
@media (min-width: 1600px) {
    /* Cho trang chủ, giữ kích thước giới hạn mặc định để không quá rộng */
    .main-container {
        max-width: 1100px; /* Tăng nhẹ cho màn hình lớn nhưng vẫn giữ giới hạn */
    }
    
    /* Cho trang chi tiết, cho phép mở rộng đầy đủ */
    .detail-page .main-container {
        max-width: none;
        width: 95%;
    }
    
    .chapter-content {
        /*font-size: 17px;
        line-height: 1.9;*/
        padding: 30px 40px;
    }
    
    .table-of-contents {
        width: 320px;
        font-size: 15px;
    }
    
    .book-icon {
        width: 100px;
        height: 100px;
    }
}

/* Tùy chỉnh cho hiển thị ảnh bìa sách */
.book-cover-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.book-cover-image:hover {
    transform: scale(1.03);
}

.no-content {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

.chapter-section {
    margin-left: 20px;
    border-left: 2px solid rgba(99, 102, 241, 0.3);
    padding-left: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Mobile media query at the end for proper overrides */
@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        overflow-x: hidden;
    }

    .main-container {
        width: 96% !important;
        max-width: 96vw !important;
        margin: 10px auto !important; /* Center using auto since body is flex-center */
        padding: 15px !important;
        border: 1px solid #6366f1 !important;
        border-radius: 12px !important;
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2) !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .books-container {
        flex-direction: column !important;
        align-items: center !important;
    }
}
