/* ==========================================
   ACMS Coupon Archive Stylesheet
   ========================================== */

.acms-archive-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 20px 15px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ==========================================
   Sidebar Filters Section
   ========================================== */

.acms-archive-sidebar {
    flex: 0 0 280px;
    width: 280px;
    box-sizing: border-box;
}

.acms-filter-widget {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.acms-filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #741FA2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acms-filter-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.acms-filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 15px;
    padding-bottom: 0;
}

.acms-filter-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #555555;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Toggle Switch Styles */
.acms-filter-toggle-wrapper {
    margin-bottom: 12px;
}

.acms-filter-toggle-wrapper:last-child {
    margin-bottom: 0;
}

.acms-filter-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    user-select: none;
    gap: 12px;
}

.acms-filter-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.acms-toggle-slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: #dddddd;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.acms-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.acms-filter-toggle input:checked + .acms-toggle-slider {
    background-color: #741FA2;
}

.acms-filter-toggle input:checked + .acms-toggle-slider:before {
    transform: translateX(16px);
}

.acms-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: #444444;
}

/* Checkbox Styles */
.acms-filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acms-scrollable-filter-list {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 6px;
}

.acms-scrollable-filter-list::-webkit-scrollbar {
    width: 4px;
}

.acms-scrollable-filter-list::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.acms-scrollable-filter-list::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

.acms-scrollable-filter-list::-webkit-scrollbar-thumb:hover {
    background: #741FA2;
}

.acms-filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #444444;
    font-weight: 500;
    user-select: none;
    width: 100%;
}

.acms-filter-checkbox input {
    margin: 0 10px 0 0;
    accent-color: #741FA2;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.acms-category-count {
    margin-left: auto;
    background: #f0f0f0;
    color: #666666;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.acms-filter-checkbox:hover .acms-category-count {
    background: #741FA2;
    color: #ffffff;
}

/* Reset Button */
.acms-filter-actions {
    margin-top: 15px;
}

.acms-reset-filters-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    color: #741FA2;
    border: 1px dashed #741FA2;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.acms-reset-filters-btn:hover {
    background: #741FA2;
    color: #ffffff;
    border-style: solid;
}

.acms-reset-icon {
    transition: transform 0.5s ease;
}

.acms-reset-filters-btn:hover .acms-reset-icon {
    transform: rotate(-180deg);
}

/* ==========================================
   Coupon Grid Section
   ========================================== */

.acms-archive-main {
    flex: 1;
    min-width: 0;
}

.acms-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ==========================================
   Pagination Styling
   ========================================== */

.acms-archive-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.acms-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #444444;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.acms-archive-pagination .page-numbers:hover {
    background: #f5f5f5;
    border-color: #cccccc;
    color: #741FA2;
}

.acms-archive-pagination .page-numbers.current {
    background: #741FA2;
    border-color: #741FA2;
    color: #ffffff;
}

.acms-archive-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.acms-pag-arrow {
    font-size: 16px;
    line-height: 1;
}

/* ==========================================
   Empty State
   ========================================== */

.acms-archive-empty {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.acms-empty-icon {
    color: #cccccc;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.acms-archive-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 10px 0;
}

.acms-archive-empty p {
    color: #666666;
    font-size: 15px;
    margin: 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */

/* Tablet Layout (768px - 1023px) */
@media (max-width: 1023px) {
    .acms-archive-container {
        flex-direction: column;
        gap: 30px;
    }

    .acms-archive-main {
        order: 1;
    }

    .acms-archive-sidebar {
        order: 2;
        flex: 0 0 auto;
        width: 100%;
    }

    .acms-filter-widget {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        padding: 20px;
    }

    .acms-filter-title {
        flex: 1 0 100%;
        margin-bottom: 10px;
    }

    .acms-filter-section {
        flex: 1 1 200px;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        border-right: 1px solid #f0f0f0;
        padding-right: 20px;
    }

    .acms-filter-section:last-of-type {
        border-right: none;
        padding-right: 0;
    }

    .acms-filter-actions {
        flex: 1 0 100%;
        margin-top: 15px;
    }

    .acms-filter-checkbox-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
    }

    .acms-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        align-items: stretch;
    }
}

/* Mobile Layout (up to 767px) */
@media (max-width: 767px) {
    .acms-archive-main {
        order: 1;
    }

    .acms-archive-sidebar {
        order: 2;
    }

    .acms-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .acms-filter-widget {
        flex-direction: column;
        gap: 16px;
    }

    .acms-filter-section {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding-right: 0;
        padding-bottom: 16px;
        flex: 1 1 auto;
    }

    .acms-filter-checkbox-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
}

/* ==========================================
   Loading State and Spinner Overlay
   ========================================== */

.acms-archive-main {
    position: relative;
    min-height: 250px;
}

.acms-archive-grid-wrapper,
.acms-archive-pagination-wrapper {
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.acms-archive-main.acms-loading .acms-archive-grid-wrapper,
.acms-archive-main.acms-loading .acms-archive-pagination-wrapper {
    opacity: 0.45;
    filter: blur(1px);
    pointer-events: none;
}

.acms-archive-loader {
    display: none;
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
}

.acms-archive-loader.acms-active {
    display: block;
}

.acms-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #741FA2;
    border-radius: 50%;
    animation: acms-spin 1s linear infinite;
    box-shadow: 0 4px 10px rgba(116, 31, 162, 0.1);
}

@keyframes acms-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Disabled styling for sidebar inputs during query */
.acms-archive-sidebar input[disabled],
.acms-archive-sidebar button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

