/* ============================================
   HOME PAGE STYLES
   ============================================ */

/* Hero */
.hero-wrapper {
    margin: 0;
    padding: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.hero-carousel {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.hero-inner,
.hero-item {
    height: 100%;
}

.hero-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
    display: block;
}

.hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2rem 2rem 2rem;
    color: #ffffff;
    text-align: left;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
}

.hero-caption h2 {
    font-size: 2.2rem;
    margin: 0 0 0.8rem 0;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.hero-caption p {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
    opacity: 0.95;
    font-weight: 300;
}

.hero-welcome-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    text-align: center;
    width: 90%;
    max-width: 800px;
    padding: 0 1rem;
}

.hero-welcome-text h1 {
    font-size: clamp(2.4rem, 4vw, 4rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    letter-spacing: 1px;
    font-style: italic;
}

.hero-welcome-text p {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #ffffff;
    margin: 0;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    font-weight: 500;
    line-height: 1.6;
    font-style: italic;
}

/* Hero slide caption text styling - match hero title style */
.hero-caption h2 {
    font-size: 2.2rem;
    margin: 0 0 0.8rem 0;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
    font-style: italic;
}

.hero-caption p {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
    opacity: 0.95;
    font-weight: 400;
    font-style: italic;
}

.hero-indicators {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: auto;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.hero-indicators button {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.8);
    border: 2px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-indicators .active {
    background-color: #ffffff;
    transform: scale(1.1);
}

.hero-control {
    width: 6%;
    border: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.hero-control-prev {
    background: linear-gradient(to right, rgba(0,0,0,0.4), transparent);
}

.hero-control-next {
    background: linear-gradient(to left, rgba(0,0,0,0.4), transparent);
}

.hero-control:hover {
    opacity: 1;
}

.hero-fallback {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: #ffffff;
    padding: 4rem 0;
}

.hero-fallback h1 {
    color: #ffffff;
    font-size: clamp(2.2rem, 3vw, 3.5rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-fallback p {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    opacity: 0.95;
}

.hero-fallback-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-btn-primary {
    font-weight: 600;
    border: none;
}

.hero-btn-secondary {
    font-weight: 600;
    border-width: 2px;
}

.hero-fallback-icon {
    color: #ffffff;
    font-size: 5rem;
    opacity: 0.9;
}

/* Home - Statistics */
.home-stats-section {
    padding: 3.5rem 0;
    margin-top: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: radial-gradient(1200px 600px at 10% 0%, #eef2ff 0%, #f8fafc 40%, #f1f5f9 100%);
}

.home-stats-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.home-stats-header h2 {
    margin: 0;
    font-size: 2.25rem;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.home-stats-header p {
    margin: 0.4rem 0 0 0;
    color: #64748b;
    font-size: 0.98rem;
}

.home-stats-update {
    opacity: .85;
    color: #475569;
    font-size: .9rem;
}

.home-stats-grid {
    --gap: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap);
    grid-auto-rows: minmax(120px, auto);
    align-items: stretch;
}

.home-stat-card {
    position: relative;
    overflow: hidden;
    padding: 1rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(2,6,23,0.06);
    border: 1px solid rgba(2,6,23,0.06);
    min-height: 130px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-stat-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.home-stat-card-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.home-stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.home-stat-card-label {
    color: #64748b;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.home-stat-card-value {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    margin-top: .2rem;
}

.home-stat-card-tag {
    font-size: .75rem;
    font-weight: 700;
}

.home-stat-card-orb {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 60%);
}

.home-stat-icon-books {
    background: rgba(2,132,199,.1);
    color: #0284c7;
}

.home-stat-icon-members {
    background: rgba(22,163,74,.1);
    color: #16a34a;
}

.home-stat-icon-loans {
    background: rgba(245,158,11,.1);
    color: #f59e0b;
}

.home-stat-icon-visits {
    background: rgba(244,63,94,.1);
    color: #f43f5e;
}

.home-stat-tag-blue {
    color: #0ea5e9;
}

.home-stat-tag-green {
    color: #22c55e;
}

.home-stat-tag-amber {
    color: #f59e0b;
}

.home-stat-tag-rose {
    color: #f43f5e;
}

.home-stat-orb-blue {
    background: radial-gradient(circle, rgba(14,165,233,.15), transparent 60%);
}

.home-stat-orb-green {
    background: radial-gradient(circle, rgba(34,197,94,.15), transparent 60%);
}

.home-stat-orb-amber {
    background: radial-gradient(circle, rgba(245,158,11,.15), transparent 60%);
}

.home-stat-orb-rose {
    background: radial-gradient(circle, rgba(244,63,94,.15), transparent 60%);
}

/* Home - Latest Books */
.home-latest-books-section {
    padding: 4rem 0;
    background-color: #f5f7fb;
}

.home-latest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.home-latest-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.home-latest-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-latest-icon-wrapper i {
    font-size: 1.2rem;
    color: #2563eb;
}

.home-latest-header h2 {
    margin: 0;
    font-size: 2.1rem;
    color: #1e293b;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.home-latest-header p {
    margin: 0.2rem 0 0 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.home-latest-more-btn {
    border-radius: 999px;
    padding: 0.55rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-width: 1px;
    border-color: #00bcd4;
    color: #2563eb;
    background: #ffffff;
}

.home-latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
}

.home-book-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.home-book-cover {
    position: relative;
    aspect-ratio: 3/4;
    background: #f1f5f9;
}

.home-book-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-book-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.home-book-cover-placeholder i {
    font-size: 2rem;
}

.home-book-category {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(2px);
}

.home-book-info {
    padding: 0.85rem 0.9rem 1rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.home-book-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
}

.home-book-author {
    font-size: 0.85rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-book-actions {
    margin-top: 0.35rem;
}

.home-book-btn-detail {
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.home-book-btn-login {
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-weight: 700;
    font-size: 0.82rem;
    background: #111827;
    border-color: #111827;
}

.home-latest-empty {
    grid-column: 1/-1;
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border: 1px dashed rgba(148, 163, 184, 0.35);
}

/* Home - Charts */
.home-chart-section {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.home-chart-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.2rem;
    color: #2c3e50;
    font-weight: 800;
}

.home-chart-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.home-chart-tab {
    white-space: nowrap;
}

.home-chart-tab i {
    margin-right: 0.5rem;
}

.home-chart-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
    width: 100%;
    overflow-x: auto;
    position: relative;
}

.home-chart-card canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
}

.home-chart-card-active {
    display: block;
}

/* Chart Container Wrapper */
.home-chart-card-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
}

/* Home - Features */
.home-features-section {
    padding: 3.5rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.home-features-header {
    text-align: center;
    margin-bottom: 2rem;
}

.home-features-header h2 {
    margin: 0;
    font-size: 2.25rem;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.home-features-header p {
    margin: 0.5rem 0 0 0;
    color: #64748b;
    font-size: 0.98rem;
}

.home-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.home-feature-card {
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: 1.2rem 1.2rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid rgba(2, 6, 23, 0.06);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.home-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.12);
}

.home-feature-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-feature-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.home-feature-icon-blue {
    background: rgba(2,132,199,.1);
    color: #0284c7;
}

.home-feature-icon-green {
    background: rgba(34,197,94,.1);
    color: #16a34a;
}

.home-feature-icon-amber {
    background: rgba(245,158,11,.12);
    color: #f59e0b;
}

.home-feature-icon-rose {
    background: rgba(244,63,94,.1);
    color: #f43f5e;
}

.home-feature-text {
    text-align: left;
}

.home-feature-title {
    color:#0f172a;
    font-weight: 800;
    letter-spacing: .02em;
}

.home-feature-desc {
    color:#64748b;
    font-size:.88rem;
}

.home-feature-orb {
    position:absolute;
    right:-25px;
    bottom:-25px;
    width:120px;
    height:120px;
    border-radius:50%;
    background: radial-gradient(circle, transparent 60%);
}

.home-feature-orb-blue {
    background: radial-gradient(circle, rgba(14,165,233,.14), transparent 60%);
}

.home-feature-orb-green {
    background: radial-gradient(circle, rgba(34,197,94,.14), transparent 60%);
}

.home-feature-orb-amber {
    background: radial-gradient(circle, rgba(245,158,11,.14), transparent 60%);
}

.home-feature-orb-rose {
    background: radial-gradient(circle, rgba(244,63,94,.14), transparent 60%);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 991.98px) {
    .hero-carousel {
        height: 70vh;
    }

    .hero-caption {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }

    .hero-caption h2 {
        font-size: 1.7rem;
    }

    .hero-caption p {
        font-size: 0.95rem;
    }

    .home-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-latest-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .hero-carousel {
        height: 60vh;
    }

    .hero-indicators {
        bottom: 1rem;
    }

    .hero-control {
        width: 12%;
    }

    .hero-fallback {
        padding: 3rem 0;
    }

    .hero-fallback-icon {
        font-size: 4rem;
    }

    .home-stats-grid {
        grid-template-columns: 1fr;
    }

    .home-latest-grid {
        grid-template-columns: 1fr;
    }

    .home-features-grid {
        grid-template-columns: 1fr;
    }

    .home-latest-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-features-header {
        text-align: left;
    }

    .home-features-header h2 {
        font-size: 1.75rem;
    }

    .home-features-header p {
        font-size: 0.9rem;
    }
}
