/* ============= GRANTHALAYA PAGE STYLES ============= */

.granthalaya-page {
    padding: 0;
    min-height: 100vh;
    color: #3e2723;
    background: #fff;
}

/* ============= HERO SECTION ============= */
.granthalaya-hero {
    background:
        /* Floating decorative circles */
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 20%),
        radial-gradient(circle at 70% 10%, rgba(62, 39, 35, 0.2) 0%, transparent 15%),
        radial-gradient(circle at 30% 90%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        /* Book pattern overlay */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='1'%3E%3Crect x='10' y='15' width='16' height='20' rx='1'/%3E%3Cline x1='13' y1='20' x2='23' y2='20'/%3E%3Cline x1='13' y1='24' x2='23' y2='24'/%3E%3Cline x1='13' y1='28' x2='20' y2='28'/%3E%3Crect x='34' y='25' width='16' height='20' rx='1'/%3E%3Cline x1='37' y1='30' x2='47' y2='30'/%3E%3Cline x1='37' y1='34' x2='47' y2='34'/%3E%3Cline x1='37' y1='38' x2='44' y2='38'/%3E%3C/g%3E%3C/svg%3E"),
        /* Main gradient */
        linear-gradient(135deg, #3e2723 0%, #8d6e63 50%, #3e2723 100%);
    padding: 90px 90px 60px 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    min-height: 500px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Animated floating orb */
.granthalaya-hero::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(141, 110, 99, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    top: -100px;
    right: -100px;
    animation: floatOrb 8s ease-in-out infinite;
}

.granthalaya-hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
    animation: floatOrb 10s ease-in-out infinite reverse;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

.granthalaya-hero-content {
    flex: 1;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.granthalaya-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.granthalaya-hero-badge .material-icons {
    font-size: 18px;
}

.granthalaya-hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 16px 0;
    color: #fff;
}

.granthalaya-hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 32px 0;
    opacity: 0.95;
    color: #fff;
}

.granthalaya-hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.granthalaya-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: "Forum", serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.granthalaya-btn.primary {
    background: #fff;
    color: #3e272399;
}

.granthalaya-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.granthalaya-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.granthalaya-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.granthalaya-btn .material-icons {
    font-size: 20px;
}

.granthalaya-hero-stats {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 36px;
    perspective: 1000px;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 10px;
    transition: transform 0.3s ease;
    overflow: visible;
}

.hero-stat-item .stat-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-stat-item strong {
    display: block;
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-stat-item span {
    display: block;
    font-size: 16px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    font-weight: 600;
    margin-top: 4px;
}

/* Common 3D Container - Scaled Up */
.stat-3d-container {
    width: 100px;
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* === BOOK IMAGE ANIMATION === */
.book-wrapper-img {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-book-img {
    width: 270px;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.3));
}

.stat-item-book:hover .hero-book-img {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.4));
}

/* === CATEGORY TREE ANIMATION === */
.tree-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-tree-img {
    width: 180px;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 10px 20px rgba(255, 167, 38, 0.4));
}

.stat-item-categories:hover .category-tree-img {
    transform: scale(1.15);
    filter: drop-shadow(0 15px 30px rgba(255, 167, 38, 0.6));
}

/* === SPINNING GLOBE (Languages) === */
.globe-wrapper {
    width: 90px;
    height: 90px;
    position: relative;
    perspective: 800px;
}

.globe {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    border-radius: 50%;
}

.globe-sphere {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: url('/Assets/globe_texture.png');
    background-size: cover;
    box-shadow: inset -10px -10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.1);
    transition: transform 1.2s ease-out;
}

.stat-item-globe:hover .globe-sphere {
    transform: rotate(220deg);
}

.globe-outer-ring {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: spin 10s linear infinite;
}

.globe-inner-ring {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: spin 6s linear infinite reverse;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============= SECTION HEADERS ============= */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
}

.section-header-left {
    flex: 1;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #3e2723;
}

.section-subtitle {
    font-size: 16px;
    color: #8d6e63;
    margin: 0;
    line-height: 1.5;
}

/* ============= FEATURED SECTION ============= */
.granthalaya-featured-section {
    padding: 80px 90px;
    background: #fafafa;
}

.granthalaya-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

/* ============= BOOK CARD - LIBRARY STYLE ============= */
.granthalaya-book-card {
    background: #fff;
    border-radius: 4px;
    overflow: visible;
    box-shadow: 0 2px 12px rgba(62, 39, 35, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Animated inner border effect */
.granthalaya-book-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 6px;
    padding: 3px;
    background: linear-gradient(135deg, #8d6e63, #3e2723, #8d6e63);
    background-size: 200% 200%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease, background-position 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.granthalaya-book-card:hover::before {
    opacity: 1;
    animation: borderGlow 2s ease infinite;
}

@keyframes borderGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.granthalaya-book-card:hover {
    box-shadow: 0 8px 32px rgba(141, 110, 99, 0.2);
}

/* Book Cover */
.granthalaya-book-cover {
    width: 100%;
    height: 280px;
    background: linear-gradient(145deg, rgba(141, 110, 99, 0.08) 0%, rgba(141, 110, 99, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-radius: 2px 2px 0 0;
}

.granthalaya-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.granthalaya-book-card:hover .granthalaya-book-cover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.granthalaya-book-cover.no-image {
    background: linear-gradient(145deg, #8d6e63 0%, rgba(141, 110, 99, 0.85) 100%);
}

/* Placeholder for no image */
.granthalaya-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #8d6e63 0%, rgba(141, 110, 99, 0.9) 100%);
}

.granthalaya-cover-placeholder .material-icons {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.35);
}

/* Bookmark Button */
.granthalaya-bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(62, 39, 35, 0.15);
    opacity: 0;
    transform: translateY(-8px);
}

.granthalaya-book-card:hover .granthalaya-bookmark-btn {
    opacity: 1;
    transform: translateY(0);
}

.granthalaya-bookmark-btn .material-icons {
    font-size: 22px;
    color: #8d6e63;
    transition: color 0.2s ease;
}

.granthalaya-bookmark-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.granthalaya-bookmark-btn:hover .material-icons {
    color: #3e2723;
}

.granthalaya-bookmark-btn.bookmarked .material-icons {
    color: #3e2723;
}

/* Book Info */
.granthalaya-book-info {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
}

.granthalaya-book-title {
    font-family: 'Forum', serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #3e2723;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.granthalaya-book-subtitle {
    font-size: 14px;
    color: #8d6e63;
    margin: 0 0 16px 0;
    line-height: 1.4;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Book Actions */
.granthalaya-book-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.granthalaya-read-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #8d6e63;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Forum', serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.granthalaya-read-btn:hover {
    background: #8d6e63;
    color: #fff;
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.3);
}

.granthalaya-read-btn .material-icons {
    font-size: 18px;
}

/* ============= CATEGORIES SECTION ============= */
.granthalaya-categories-section {
    padding: 80px 90px;
    background: #fff;
}

.granthalaya-categories-header {
    text-align: center;
    margin-bottom: 48px;
}

.granthalaya-categories-header .section-title {
    font-size: 32px;
    color: #3e2723;
    margin-bottom: 12px;
    font-family: 'Forum', serif;
}

.granthalaya-categories-header .section-subtitle {
    font-size: 16px;
    color: #8d6e63;
    margin: 0;
    opacity: 0.9;
}

.granthalaya-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.granthalaya-category-card {
    position: relative;
    padding: 28px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(141, 110, 99, 0.15);
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.granthalaya-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #8d6e63 0%, #3e2723 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.granthalaya-category-card:hover {
    box-shadow: 0 12px 40px rgba(62, 39, 35, 0.12);
    border-color: rgba(141, 110, 99, 0.3);
}

.granthalaya-category-card:hover::before {
    opacity: 1;
}

.granthalaya-category-icon-wrapper {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(141, 110, 99, 0.12) 0%, rgba(62, 39, 35, 0.08) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.granthalaya-category-card:hover .granthalaya-category-icon-wrapper {
    background: linear-gradient(135deg, #8d6e63 0%, #3e2723 100%);
    transform: scale(1.05);
}

.granthalaya-category-icon {
    font-size: 28px;
    color: #8d6e63;
    transition: color 0.3s ease;
}

.granthalaya-category-card:hover .granthalaya-category-icon {
    color: #fff;
}

.granthalaya-category-content {
    flex: 1;
    min-width: 0;
}

.granthalaya-category-name {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #3e2723;
    font-family: 'Forum', serif;
    line-height: 1.3;
}

.granthalaya-category-count {
    font-size: 13px;
    color: #8d6e63;
    margin: 0;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.granthalaya-category-count .material-icons {
    font-size: 14px;
}

.granthalaya-category-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    opacity: 0;
    color: #8d6e63;
    transition: all 0.3s ease;
}

.granthalaya-category-card:hover .granthalaya-category-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Category empty state */
.granthalaya-categories-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8d6e63;
}

.granthalaya-categories-empty .material-icons {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.granthalaya-categories-empty p {
    margin: 0;
    font-size: 16px;
}

/* Load More Button */
.granthalaya-load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.granthalaya-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid #8d6e63;
    border-radius: 50px;
    color: #8d6e63;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Forum', serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.granthalaya-load-more-btn:hover {
    background: #8d6e63;
    color: #fff;
}

.granthalaya-load-more-btn .material-icons {
    font-size: 20px;
}

/* Category Dropdown Selector */
.granthalaya-category-select {
    padding: 12px 16px;
    border: 2px solid #8d6e63;
    border-radius: 8px;
    font-size: 14px;
    color: #3e2723;
    background: #fff;
    transition: all 0.3s ease;
    min-width: 200px;
    cursor: pointer;
    font-family: inherit;
}

.granthalaya-category-select:focus {
    outline: none;
    border-color: #3e2723;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
}

.granthalaya-category-select option {
    padding: 8px 12px;
}

/* ============= ALL BOOKS SECTION ============= */
.granthalaya-all-books-section {
    padding: 80px 90px;
    background: #fafafa;
}

.granthalaya-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============= CUSTOM CATEGORY DROPDOWN ============= */
.granthalaya-dropdown {
    position: relative;
    min-width: 240px;
}

.granthalaya-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #8d6e63;
    border-radius: 10px;
    color: #3e2723;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(141, 110, 99, 0.08);
}

.granthalaya-dropdown-btn:hover {
    border-color: #3e2723;
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.15);
}

.granthalaya-dropdown.open .granthalaya-dropdown-btn {
    border-color: #3e2723;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 4px 12px rgba(141, 110, 99, 0.15);
}

.granthalaya-dropdown-icon {
    color: #8d6e63;
    font-size: 20px;
}

.granthalaya-dropdown-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.granthalaya-dropdown-arrow {
    color: #8d6e63;
    font-size: 22px;
    transition: transform 0.3s ease;
}

.granthalaya-dropdown.open .granthalaya-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.granthalaya-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #3e2723;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 100;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 8px 20px rgba(62, 39, 35, 0.15);
}

.granthalaya-dropdown.open .granthalaya-dropdown-menu {
    max-height: 320px;
    overflow-y: auto;
    opacity: 1;
}

/* Dropdown Items */
.granthalaya-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #3e2723;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(141, 110, 99, 0.1);
}

.granthalaya-dropdown-item:last-child {
    border-bottom: none;
}

.granthalaya-dropdown-item .material-icons {
    font-size: 20px;
    color: #8d6e63;
    transition: color 0.2s ease;
}

.granthalaya-dropdown-item:hover {
    background: linear-gradient(135deg, rgba(141, 110, 99, 0.1) 0%, rgba(141, 110, 99, 0.05) 100%);
}

.granthalaya-dropdown-item:hover .material-icons {
    color: #3e2723;
}

.granthalaya-dropdown-item.active {
    background: linear-gradient(135deg, rgba(141, 110, 99, 0.15) 0%, rgba(62, 39, 35, 0.1) 100%);
    font-weight: 600;
}

.granthalaya-dropdown-item.active .material-icons {
    color: #3e2723;
}

/* Scrollbar styling for dropdown */
.granthalaya-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.granthalaya-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(141, 110, 99, 0.05);
    border-radius: 3px;
}

.granthalaya-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(141, 110, 99, 0.3);
    border-radius: 3px;
}

.granthalaya-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(141, 110, 99, 0.5);
}

/* Search Bar Wrapper */
.granthalaya-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 450px;
}

.granthalaya-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8d6e63;
    font-size: 22px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.granthalaya-search {
    width: 100%;
    padding: 14px 48px 14px 50px;
    border: 2px solid #8d6e63;
    border-radius: 50px;
    font-size: 14px;
    color: #3e2723;
    background: #fff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.granthalaya-search::placeholder {
    color: rgba(141, 110, 99, 0.6);
}

.granthalaya-search:hover {
    border-color: #3e2723;
}

.granthalaya-search:focus {
    outline: none;
    border-color: #3e2723;
    box-shadow: 0 0 0 4px rgba(141, 110, 99, 0.15);
}

.granthalaya-search:focus+.granthalaya-search-icon,
.granthalaya-search-wrapper:focus-within .granthalaya-search-icon {
    color: #3e2723;
}

.granthalaya-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(141, 110, 99, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.granthalaya-search-clear .material-icons {
    font-size: 18px;
    color: #8d6e63;
}

.granthalaya-search:not(:placeholder-shown)~.granthalaya-search-clear,
.granthalaya-search-wrapper:focus-within .granthalaya-search-clear {
    opacity: 1;
}

.granthalaya-search-clear:hover {
    background: rgba(141, 110, 99, 0.2);
}

.granthalaya-search-clear:hover .material-icons {
    color: #3e2723;
}

.granthalaya-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

/* ============= EMPTY STATE ============= */
.granthalaya-empty-state {
    padding: 60px 40px;
    text-align: center;
    background: rgba(216, 67, 21, 0.05);
    border-radius: 12px;
    border: 2px dashed #ffab40;
}

.granthalaya-empty-state .material-icons {
    font-size: 64px;
    color: #ffab40;
    margin-bottom: 16px;
}

.granthalaya-empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #3e2723;
}

.granthalaya-empty-state p {
    font-size: 16px;
    color: #8d6e63;
    margin: 0;
    line-height: 1.5;
}

/* ============= QUOTES SECTION ============= */
.granthalaya-quotes-section {
    padding: 80px 90px;
    background: #8d6e6314;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.quotes-content-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
}

.quotes-image-container {
    flex: 0 0 400px;
    position: relative;
}

.sage-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
}

.quotes-text-content {
    flex: 1;
}

.quotes-heading {
    font-size: 16px;
    text-transform: capitalize;
    letter-spacing: 2px;
    color: #d84315;
    margin-bottom: 90px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quote-block {
    position: relative;
}

.quote-text {
    font-family: "Forum", serif;
    font-size: 42px;
    color: #3e2723;
    line-height: 1.3;
    margin: 0 0 24px 0;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.quote-author {
    font-size: 20px;
    color: #8d6e63;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1024px) {
    .granthalaya-hero {
        flex-direction: column;
        padding: 60px 60px;
        gap: 40px;
        min-height: auto;
    }

    .granthalaya-hero-title {
        font-size: 36px;
    }

    .granthalaya-page {
        padding: 0;
    }

    .granthalaya-featured-section,
    .granthalaya-categories-section,
    .granthalaya-all-books-section {
        padding: 60px 60px;
    }

    .section-header-row {
        flex-direction: column;
        gap: 20px;
    }

    .granthalaya-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .granthalaya-search-wrapper {
        min-width: auto;
        max-width: none;
    }

    .granthalaya-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .granthalaya-quotes-section {
        padding: 60px 40px;
    }

    .quotes-content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .quotes-image-container {
        flex: 0 0 auto;
        width: 300px;
    }

    .quotes-heading {
        justify-content: center;
    }

    .quote-text {
        font-size: 32px;
    }

    .quote-author {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .granthalaya-hero {
        padding: 40px 20px;
    }

    .granthalaya-hero-title {
        font-size: 28px;
    }

    .granthalaya-hero-subtitle {
        font-size: 16px;
    }

    .granthalaya-hero-cta {
        flex-direction: column;
    }

    .granthalaya-btn {
        width: 100%;
        justify-content: center;
    }

    .granthalaya-featured-section,
    .granthalaya-categories-section,
    .granthalaya-all-books-section {
        padding: 40px 20px;
    }

    .section-title {
        font-size: 28px;
    }

    .granthalaya-featured-grid,
    .granthalaya-categories-grid,
    .granthalaya-books-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .granthalaya-hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .hero-stat-item {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .hero-stat-item .material-icons {
        font-size: 32px;
    }

    .hero-stat-item strong {
        font-size: 20px;
    }
}

/* ============= BOOKMARK TOAST NOTIFICATION ============= */
.bookmark-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #3e2723 0%, #8d6e63 100%);
    color: #fff;
    padding: 16px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(62, 39, 35, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bookmark-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.bookmark-toast .material-icons {
    font-size: 22px;
}

/* ============= BOOKMARK LOGIN MODAL ============= */
.bookmark-login-modal {
    position: fixed;
    inset: 0;
    background: rgba(62, 39, 35, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bookmark-login-modal.show {
    opacity: 1;
    visibility: visible;
}

.bookmark-login-content {
    background: #fff;
    padding: 48px;
    border-radius: 16px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(62, 39, 35, 0.25);
}

.bookmark-login-modal.show .bookmark-login-content {
    transform: scale(1);
}

.bookmark-login-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #8d6e63;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bookmark-login-close:hover {
    background: rgba(141, 110, 99, 0.1);
    color: #3e2723;
}

.bookmark-login-icon {
    font-size: 64px;
    color: #8d6e63;
    margin-bottom: 16px;
}

.bookmark-login-content h3 {
    font-size: 24px;
    color: #3e2723;
    margin: 0 0 12px 0;
}

.bookmark-login-content p {
    font-size: 15px;
    color: #8d6e63;
    margin: 0 0 28px 0;
    line-height: 1.5;
}

.bookmark-login-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.bookmark-login-btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bookmark-login-btn.primary {
    background: linear-gradient(135deg, #8d6e63 0%, #3e2723 100%);
    color: #fff;
}

.bookmark-login-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(141, 110, 99, 0.4);
    transform: translateY(-2px);
}

.bookmark-login-btn.secondary {
    background: transparent;
    color: #3e2723;
    border: 2px solid #8d6e63;
}

.bookmark-login-btn.secondary:hover {
    background: rgba(141, 110, 99, 0.1);
}

/* Tablet Responsive (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {

    /* Hero section - add top padding and adjust margins */
    .granthalaya-hero {
        padding: 100px 0 60px 0;
        /* Increased top padding from 90px to 120px, sides from 90px to 30px */
        gap: 40px;
    }

    /* Stats - add gap between the two decorative images */
    .granthalaya-hero-stats {
        gap: 100px;
        /* Increased from 36px to 100px for better spacing */
    }

    /* Adjust sections padding */
    .granthalaya-featured-section {
        padding: 80px 30px;
    }

    .granthalaya-categories-section {
        padding: 80px 30px;
    }

    .granthalaya-all-books-section {
        padding: 80px 30px;
    }

    /* Categories grid - 2 columns on tablet */
    .granthalaya-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Responsive (320px - 767px) */
@media screen and (max-width: 767px) {

    /* Hero section - reduce padding */
    .granthalaya-hero {
        padding: 80px 10px 40px 10px !important;
        flex-direction: column;
        gap: 30px;
        min-height: auto;
    }

    .granthalaya-hero-content {
        max-width: 100%;
        text-align: center;
    }

    .granthalaya-hero-title {
        font-size: 32px !important;
    }

    .granthalaya-hero-subtitle {
        font-size: 16px !important;
    }

    /* Hero Stats - Reduce image sizes and add gap */
    .granthalaya-hero-stats {
        flex-direction: row !important;
        gap: 20px !important;
        justify-content: center;
        padding: 10px 0;
    }

    .hero-stat-item {
        gap: 16px !important;
        padding: 5px !important;
    }

    .hero-stat-item img {
        max-width: 120px !important;
        max-height: 120px !important;
        width: 100% !important;
        height: auto !important;
    }

    .hero-stat-item strong {
        font-size: 24px !important;
    }

    .hero-stat-item span {
        font-size: 12px !important;
    }

    /* Search and Filter - Single Horizontal Row */
    .granthalaya-filters {
        flex-direction: row !important;
        gap: 12px !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .granthalaya-search-wrapper {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .granthalaya-dropdown {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 50px !important;
    }

    .granthalaya-dropdown-btn {
        padding: 12px !important;
        min-width: 50px !important;
    }

    .granthalaya-dropdown-btn span:not(.material-icons) {
        display: none !important;
    }

    /* Dropdown menu - compact on mobile */
    .granthalaya-dropdown-menu {
        border-top: 2px solid #3e2723 !important;
        max-height: 280px !important;
        font-size: 13px !important;
        width: 100% !important;
        min-width: 200px !important;
        left: -120px !important;
        right: 0 !important;
    }

    .granthalaya-dropdown-item {
        padding: 10px 12px !important;
        gap: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .granthalaya-dropdown-item .material-icons {
        font-size: 18px !important;
        flex-shrink: 0 !important;
    }

    /* Featured Scriptures - Horizontal Swipe */
    .granthalaya-featured-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 16px !important;
        padding: 0 10px !important;
        cursor: grab !important;
    }

    .granthalaya-featured-grid:active {
        cursor: grabbing !important;
    }

    .granthalaya-featured-grid::-webkit-scrollbar {
        display: none;
    }

    .granthalaya-featured-grid .granthalaya-book-card {
        flex: 0 0 calc(60% - 8px) !important;
        min-width: calc(60% - 8px) !important;
        scroll-snap-align: start;
    }

    /* Complete Library - Horizontal Swipe */
    .granthalaya-books-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 16px !important;
        padding: 0 10px !important;
        cursor: grab !important;
    }

    .granthalaya-books-grid:active {
        cursor: grabbing !important;
    }

    .granthalaya-books-grid::-webkit-scrollbar {
        display: none;
    }

    .granthalaya-books-grid .granthalaya-book-card {
        flex: 0 0 calc(60% - 8px) !important;
        min-width: calc(60% - 8px) !important;
        scroll-snap-align: start;
    }

    /* Section padding */
    .granthalaya-featured-section,
    .granthalaya-categories-section,
    .granthalaya-all-books-section {
        padding: 40px 10px !important;
    }

    /* Section titles */
    .granthalaya-section-title {
        font-size: 28px !important;
        margin-bottom: 20px !important;
    }

    /* Browse by Category - Vertical Grid (1 column) */
    .granthalaya-categories-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .granthalaya-category-card {
        width: 100% !important;
    }

    /* Book cards - adjust for mobile */
    .granthalaya-book-card {
        min-height: 200px !important;
        /* Reduced from 280px */
    }

    .granthalaya-book-cover {
        height: 140px !important;
        /* Reduced from 180px */
    }

    .granthalaya-book-card-title {
        font-size: 14px !important;
    }

    .granthalaya-book-card-author {
        font-size: 12px !important;
    }
}