/* Body Background */
body {
    background-color: #ffffff; /* Dark blue-gray to match AI theme */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Roboto', sans-serif; /* Consistent font */
    color: black; /* Default text color for readability */
}
.book-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 221, 235, 0.2);
}

.responsive {
    width: 25%;
    padding: 15px;
    box-sizing: border-box;
    transition: all 0.4s ease;
}

.gallery {
    background-color: #ffffff;
    border: 1px solid rgba(0, 221, 235, 0.3);
    border-radius: 12px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery:hover::before {
    opacity: 1;
}

.gallery:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 221, 235, 0.7);
    box-shadow: 0 8px 25px rgba(0, 221, 235, 0.3);
}

.gallery img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: filter 0.3s ease;
}

.gallery:hover img {
    filter: brightness(1.1);
}

.desc {
    text-align: center;
    padding: 5px;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(0, 221, 235, 0.5);
}

.desc:first-of-type {
    font-weight: 600;
    font-size: 1em;
    color: #00ddeb;
}

.card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Styling for links in card-footer */
.card-footer a {
    color: #00ddeb;
    text-decoration: none;
    padding: 10px 16px;
    font-size: 0.95em;
    border-radius: 6px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    box-sizing: border-box;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

/* Override PHP classes to ensure clickability */
.card-footer a.btn.btn-sm.text-dark.p-0 {
    padding: 10px 16px !important;
    color: #00ddeb !important;
    background: rgba(0, 221, 235, 0.1);
}

/* Specific styling for "ဖတ်ရန်" link */
.card-footer a:first-child {
    background: rgba(0, 221, 235, 0.2);
    font-weight: 600;
}

.card-footer a:hover {
    background: rgba(0, 221, 235, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 221, 235, 0.4);
}

.card-footer a:first-child:hover {
    background: rgba(0, 221, 235, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 20px rgba(0, 221, 235, 0.6);
}

.card-footer a i {
    margin-right: 6px; 
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: center;
    margin: 30px 0 100px 0;
    gap: 10px; /* Increased gap for better spacing */
    padding: 0 10px; /* Prevent overflow on edges */
}

.pagination a, .pagination span {
    padding: 10px 16px;
    color: #00ddeb;
    text-decoration: none;
    border: 1px solid rgba(0, 221, 235, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 40px; /* Minimum width for clickability */
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative; 
    z-index: 1;
    font-size: 1em; /* Base font size */
}

.pagination a:hover:not(.active) {
    background: rgba(0, 221, 235, 0.2);
    transform: scale(1.05);
}

.pagination a.active {
    background: #00ddeb;
    color: #0a192f;
    border-color: #00ddeb;
    box-shadow: 0 0 15px rgba(0, 221, 235, 0.5);
    cursor: default;
}

/* Bottom Tab Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95), rgba(30, 60, 114, 0.95));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.nav-item {
    text-align: center;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    transition: all 0.3s ease;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-item span {
    opacity: 0.9;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00ddeb;
    transform: translateY(-2px);
}

.nav-item:hover i {
    transform: scale(1.2);
}

.nav-item.active {
    color: #00ddeb;
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #00ddeb;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ddeb;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .responsive { width: 33.33%; }
}

@media (max-width: 768px) {
    .responsive { width: 50%; }
    .gallery img { height: 150px; }
    .card-footer a {
        padding: 8px 12px;
        min-width: 80px;
        font-size: 0.9em;
    }
    .nav-item {
        padding: 6px 8px;
        font-size: 10px;
    }
    .nav-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    .nav-item span {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .responsive { width: 100%; }
    .gallery img { height: 140px; }
    .desc { font-size: 0.9em; }
    .card-footer a {
        padding: 6px 10px;
        min-width: 70px;
        font-size: 0.85em;
    }
    .card-footer { gap: 5px; }
    .nav-tabs { padding: 0 5px; }
    .nav-item {
        padding: 3px 4px;
    }
    .nav-item i {
        font-size: 16px;
    }
    .nav-item span {
        display: none;
    }
}

/* Subtle AI Animation */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px rgba(0, 221, 235, 0.4); }
    50% { box-shadow: 0 0 20px rgba(0, 221, 235, 0.6); }
    100% { box-shadow: 0 0 5px rgba(0, 221, 235, 0.4); }
}

.gallery:hover {
    animation: pulseGlow 1.5s infinite;
}

.nav-item.active i {
    animation: pulseGlow 2s infinite;
}
/* Category Container */
.categorycontainer {
    max-width: 1200px;
    margin: 40px auto; /* Centered with top/bottom spacing */
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 221, 235, 0.2);
    position: relative;
    z-index: 1; /* Ensure it’s above any background elements */
}

.categorycontainer h1 {
    text-align: center;
    color: black; /* Cyan for heading */
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(0, 221, 235, 0.5);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Responsive grid */
    gap: 20px;
    padding: 10px;
}

/* Category Item */
.category-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 221, 235, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.category-item a {
    color: black;
    text-decoration: none;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: color 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 221, 235, 0.7);
    box-shadow: 0 8px 25px rgba(0, 221, 235, 0.3);
}

.category-item a:hover {
    color: #00ddeb; /* Cyan on hover */
}

.category-item .emoji {
    font-size: 2em; /* Larger emoji */
    margin-bottom: 10px;
    display: block;
}

/* Bottom Tab Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.nav-item {
    text-align: center;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    transition: all 0.3s ease;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-item span {
    opacity: 0.9;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00ddeb;
    transform: translateY(-2px);
}

.nav-item:hover i {
    transform: scale(1.2);
}

.nav-item.active {
    color: #00ddeb;
    background: rgba(255, 255, 255, 0.15);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #00ddeb;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ddeb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    .category-item {
        padding: 10px;
    }
    .category-item .emoji {
        font-size: 1.5em;
    }
    .category-item a {
        font-size: 0.9em;
    }
    .nav-item {
        padding: 6px 8px;
        font-size: 10px;
    }
    .nav-item i {
        font-size: 18px;
        margin-bottom: 2px;
    }
    .nav-item span {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .categorycontainer {
        margin: 20px auto;
        padding: 15px;
    }
    .categorycontainer h1 {
        font-size: 1.5em;
    }
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .category-item {
        padding: 8px;
    }
    .category-item .emoji {
        font-size: 1.2em;
        margin-bottom: 5px;
    }
    .category-item a {
        font-size: 0.85em;
    }
    .nav-tabs {
        padding: 0 5px;
    }
    .nav-item {
        padding: 5px 6px;
    }
    .nav-item i {
        font-size: 16px;
    }
    .nav-item span {
        display: none; /* Hide text on small screens */
    }
}

/* Subtle AI Animation */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px rgba(0, 221, 235, 0.4); }
    50% { box-shadow: 0 0 20px rgba(0, 221, 235, 0.6); }
    100% { box-shadow: 0 0 5px rgba(0, 221, 235, 0.4); }
}

.category-item:hover {
    animation: pulseGlow 1.5s infinite;
}

.nav-item.active i {
    animation: pulseGlow 2s infinite;
}