/* === Guide Library - FINAL UI STYLES v2.0 === */

/* --- 1. Global Wrapper & Design System --- */
#guide-library-plugin-wrapper {
    --gl-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --gl-gold: #C5BA90;
    --gl-text-blue: #0d2b4f;
    --gl-bg-color: #f8f9fa;
    --gl-card-bg: #ffffff;
    --gl-border-color: #dee2e6;
    --gl-slider-gray: #a0aec0;
    --gl-radius-md: 12px;
    --gl-radius-pill: 50px;
    --gl-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    font-family: var(--gl-font-family);
    color: var(--gl-text-blue);
    /* background-color: var(--gl-bg-color); */
}

#guide-library-plugin-wrapper *,
#guide-library-plugin-wrapper *::before,
#guide-library-plugin-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    text-shadow: none;
}

#guide-library-plugin-wrapper a {
    text-decoration: none;
    color: inherit;
}

#guide-library-plugin-wrapper p {
    line-height: 1.6;
}

.gl-icon-img {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.3em;
    position: relative;
}

/* --- 2. Grid, Filters, Cards --- */
#guide-library-plugin-wrapper .guide-library-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    max-width: 1440px;
    margin: 50px auto;
    padding: 0 20px;
}

#guide-library-plugin-wrapper .guide-filters {
    background: #fff;
    padding: 30px;
    border-radius: var(--gl-radius);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    height: fit-content;
}

#guide-library-plugin-wrapper .filters-title {
    margin-bottom: 25px;
    color: #000;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    border-bottom: 1px solid #D9D9D9;
    padding-bottom: 20px;
}

#guide-library-plugin-wrapper .filter-group {
    margin-bottom: 20px;
}

#guide-library-plugin-wrapper .filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #303A54;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: 124.5%;
    /* 14.94px */
    letter-spacing: 0.18px;
}

#guide-library-plugin-wrapper .filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
}

#guide-library-plugin-wrapper .filter-button {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gl-gold);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
}

#guide-library-plugin-wrapper .filter-button:hover {
    background-color: var(--gl-gold);
    color: var(--gl-card-bg);
}

#guide-library-plugin-wrapper .filter-button .gl-icon-img {
    margin-left: 8px;
}

/* --- 3. Main Grid Layout --- */
#guide-library-plugin-wrapper .guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
}

/* --- 4. Card Styling --- */
#guide-library-plugin-wrapper .guide-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--gl-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
    position: relative;
}

#guide-library-plugin-wrapper .guide-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(13, 43, 79, 0.12);
}



#guide-library-plugin-wrapper .guide-year-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #C5BA90;
    backdrop-filter: blur(5px);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

#guide-library-plugin-wrapper .card-details {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#guide-library-plugin-wrapper .card-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--gl-text-blue);
    margin-bottom: 12px;
    line-height: 1.4;
}

#guide-library-plugin-wrapper .card-meta {
    font-size: 13px;
    color: #718096;
    margin-bottom: 20px;
}

#guide-library-plugin-wrapper .card-button {
    width: 100%;
    justify-content: center;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 12px;
    color: var(--gl-text-blue);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

#guide-library-plugin-wrapper .card-button:hover {
    background: var(--gl-gold);
    color: #fff;
}

#guide-library-plugin-wrapper .card-button .gl-icon-img {
    transition: transform 0.2s ease-in-out;
}

#guide-library-plugin-wrapper .card-button:hover .gl-icon-img {
    transform: translateX(4px);
}

#guide-library-plugin-wrapper .card-cover {
    flex-basis: 320px;
    overflow: hidden;
}

#guide-library-plugin-wrapper .card-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.6s ease;

}

.guide-card:hover .card-cover img {
    transform: scale(1.08);
}


/* --- 5. Single Guide Page Styling --- */
#guide-library-plugin-wrapper .guide-single-container {
    max-width: 100%;
    margin: -23px auto;
    padding: 63px 40px;
    background-color: #F1F3F6;
    border-radius: var(--gl-radius-md);
}

#guide-library-plugin-wrapper .guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 20px;
    margin-bottom: 20px;
}

#guide-library-plugin-wrapper .guide-title {
    color: #021A2D;
    font-family: 'Mooli', sans-serif;
    font-size: 42px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin-bottom: 40px;
}

#guide-library-plugin-wrapper .guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
}

#guide-library-plugin-wrapper .guide-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #013B9B;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

#guide-library-plugin-wrapper .guide-actions {
    display: flex;
    gap: 15px;
}

#guide-library-plugin-wrapper .action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--gl-gold);
    border-radius: var(--gl-radius-pill);
    color: #303A54;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}

#guide-library-plugin-wrapper .action-button:hover {
    background-color: var(--gl-gold);
    color: var(--gl-card-bg);
}

#guide-library-plugin-wrapper .flipbook-wrapper {
    background: var(--gl-bg-color);
    padding: 20px;
    border-radius: var(--gl-radius-md);
    margin-top: -5px;
    background: var(--gl-bg-color);
    padding: 35px;
    border-radius: var(--gl-radius-md);
}


/* For Tablets and smaller laptops (e.g., < 992px) */
@media (max-width: 992px) {
    #guide-library-plugin-wrapper .guide-library-container {
        /* Stack the filter sidebar on top of the grid */
        grid-template-columns: 1fr;
        gap: 30px;
    }

    #guide-library-plugin-wrapper .guide-grid {
        /* Switch the main grid to a single column */
        grid-template-columns: 1fr;
    }
}

/* For Mobile devices (e.g., < 768px) */
@media (max-width: 768px) {
    #guide-library-plugin-wrapper .guide-single-container {
        padding: 63px 15px;
    }

    #guide-library-plugin-wrapper .guide-card {
        flex-direction: column-reverse;
    }

    #guide-library-plugin-wrapper .card-cover {
        flex-basis: auto;
        height: 250px;
    }

    #guide-library-plugin-wrapper .card-details {
        padding: 30px;
    }

    #guide-library-plugin-wrapper .card-title {
        font-size: 1.5rem;
    }

    #guide-library-plugin-wrapper .guide-title {
        font-size: 28px;
    }
}

/* --- 7. Flipbook Control Bar Overrides (Unchanged) --- */
#guide-library-plugin-wrapper .d-flip-book-container .df-ui-controls {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    color: var(--gl-slider-gray) !important;
    padding: 15px 10px !important;
}

#guide-library-plugin-wrapper .df-ui-zoom-out,
#guide-library-plugin-wrapper .df-ui-fullscreen,
#guide-library-plugin-wrapper .df-ui-share {
    display: none !important;
}

#guide-library-plugin-wrapper .df-ui-btn {
    background: transparent !important;
    color: var(--gl-slider-gray) !important;
    width: 175px !important;
    height: 36px !important;
    transition: color 0.2s ease;
}

#guide-library-plugin-wrapper .df-ui-btn:hover {
    color: var(--gl-text-blue) !important;
}

#guide-library-plugin-wrapper .df-ui-btn>span::before {
    font-size: 24px !important;
}

#guide-library-plugin-wrapper .df-ui-current-page {
    font-size: 1rem !important;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
}

#guide-library-plugin-wrapper .df-ui-slider-bar {
    background-color: #cbd5e0 !important;
    height: 4px !important;
    border-radius: 4px;
    top: calc(50% - 2px) !important;
}

#guide-library-plugin-wrapper .df-ui-slider-handle {
    background-color: var(--gl-slider-gray) !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    border: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
    top: calc(50% - 9px) !important;
    margin-left: -9px !important;
}

/* --- ADD THIS AT THE END OF frontend.css --- */

/* --- 8. AJAX Loading State --- */
#guide-grid-results {
    position: relative;
    transition: opacity 0.3s ease-in-out;
}

.gl-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--gl-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 10;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* --- 8. Custom Flipbook Controls --- */

/* Add padding to the main container to prevent content from being hidden by the fixed bar */
#guide-library-plugin-wrapper .guide-single-container {
    padding-bottom: 80px;
    /* Adjust this value based on the control bar's height */
}

.gl-custom-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    /* A fixed height */
    background-color: #ffffff;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    gap: 20px;
    z-index: 100000;
    /* High z-index to be on top of everything */
}

.gl-ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gl-ctrl-btn svg {
    width: 22px;
    height: 22px;
    fill: #888;
    transition: fill 0.2s ease-in-out;
}

.gl-ctrl-btn:hover svg {
    fill: #111;
}

.gl-page-display {
    font-family: var(--gl-font-family);
    font-size: 15px;
    color: #555;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.gl-slider-wrapper {
    flex-grow: 1;
    max-width: 500px;
    /* Limit the max width of the slider */
    display: flex;
    align-items: center;
}

/* Custom Slider Styles */
.gl-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
}

.gl-slider:hover {
    opacity: 1;
}

.gl-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4a5568;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.gl-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4a5568;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments for the control bar */
@media (max-width: 768px) {
    #guide-library-plugin-wrapper .df-ui-btn {
        background-color: #fff !important;
        width: 39px !important;
    }

    .gl-custom-controls {
        padding: 0 10px;
        gap: 10px;
        height: 60px;
    }

    .gl-page-display {
        min-width: 65px;
        font-size: 14px;
    }

    .gl-slider-wrapper {
        max-width: 300px;
    }
}

@media (max-width: 480px) {

    /* On very small screens, hide the page number to save space */
    .gl-page-display {
        display: none;
    }
}


.guide-description {
    margin: 30px 0;
    line-height: 1.8;
    color: #434F6D;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
}

.guide-description p {
    margin-bottom: 15px;
}

/* Ensure the Elementor Header Overrides look good */
.elementor-heading-title.elementor-size-default {
    transition: all 0.3s ease;
}

/* ... (Keep your existing grid/card styles) ... */

.guide-main-content {
    display: flex;
    flex-direction: column;
}

#load-more-guides {
    width: auto;
    display: inline-flex;
    padding: 12px 40px;
    margin: 20px auto;
    background-color: #fff;
    border: 1px solid #C5BA90;
    color: #303A54;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
}

#load-more-guides:hover {
    background-color: #C5BA90;
    color: #fff;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}