/**
 * Notifal Marketplace Archive Styles
 *
 * @package Notifal Marketplace
 * @since 1.0.0
 */

/* Global Font Family */
.notifal-marketplace-archive,
.notifal-marketplace-archive *,
.notifal-theme-hero-section-box,
.notifal-theme-hero-section-box * {
    font-family: "Raleway", Sans-serif !important;
}


/* Hero Section Styles */
.notifal-theme-hero-section-box {
    text-align: center;
    padding: 60px 0 30px 0;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: "Raleway", Sans-serif !important;
}

/* Pattern overlay for background */
.notifal-theme-hero-section-box::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.notifal-theme-hero-section-box h1 {
    color: #ffffff;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    font-family: "Raleway", Sans-serif !important;
    position: relative;
    z-index: 1;
}

.notifal-theme-hero-section-box p {
    color: #ffffff;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 50px;
    font-family: "Raleway", Sans-serif !important;
    position: relative;
    z-index: 1;
}

.trending-categories {
    position: relative;
    z-index: 1;
    margin-top: 70px;
}

.trending-categories h2 {
    color: #ffffff !important;
    font-size: 18px !important;
    font-family: "Raleway", Sans-serif !important;
    font-weight: 500 !important;
    margin-bottom: 9px !important;
}

.category-tags {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}



.category-tag {
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
    font-family: "Raleway", Sans-serif !important;
    font-weight: 500;
    color: #fff !important;
}

.category-tag:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Archive Container */
.notifal-marketplace-archive {
    font-family: "Raleway", Sans-serif !important;
    background-color: #fff;
    padding: 20px;
    min-height: 600px;
}

.archive-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 10px;
}

/* Sidebar */
.archive-sidebar {
    height: fit-content;
    position: sticky;
    top: 20px;
    height: 80vh;
    overflow: auto;
}

.filter-sidebar {
    padding: 5px;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #F8EBFF;
    padding-bottom: 10px;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-section-header h3 {
    font-size: 20px !important;
    margin: 0 !important;
    color: #1a1a1a;
    font-weight: 600;
    flex: 1;
}

.filter-section-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #7c3aed;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.filter-section-toggle:hover {
    color: #6d28d9;
    background-color: rgba(124, 58, 237, 0.08);
}

.filter-section-toggle:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

.filter-section-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.filter-section.filter-section--collapsed .filter-section-toggle-icon {
    transform: rotate(180deg);
}

.filter-section.filter-section--taxonomy .filter-options-wrapper {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease;
}

.filter-section.filter-section--collapsed .filter-options-wrapper {
    max-height: 0;
    margin-bottom: 0;
}

.filter-section > h3 {
    font-size: 20px !important;
    margin-bottom: 15px;
    color: #1a1a1a;
    font-weight: 600;
}

.filter-section:last-child {
    margin-bottom: 0;
}


/* Filter Options Wrapper */
.filter-options-wrapper {
    margin-bottom: 10px;
}

/* Filter Options */
.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid #7B2CBF;
      border-bottom-width: 2px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border-bottom-width: 3px;
}

.filter-option input[type="checkbox"]:checked {
    background-color: #7B2CBF;
    border-color: #7B2CBF;
}

.filter-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.filter-option input[type="radio"] {
    border-radius: 50%;
}

.filter-option input[type="radio"]:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

.filter-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
}

.filter-option label {
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    flex: 1;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 6px;
}

.filter-option:hover label {
    color: #7c3aed;
}

/* Filter Count Badge */
.taxonomy-filter-count {
    color: #ababab;
}


/* Clear Filters Button */
.clear-filters-btn {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e5e5;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.clear-filters-btn:hover {
    background: #e5e5e5;
    border-color: #d1d5db;
}

/* Main Content */
.archive-main-content {
    padding: 30px;
}

/* Archive Search Section */
.archive-search-section {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

.archive-search-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.archive-search-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 480px;
}

.archive-search-input {
    width: 100%;
    max-width: 480px;
    padding: 12px 16px;
    font-size: 16px;
    font-family: "Raleway", sans-serif;
    color: #1a1a1a;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.archive-search-input::placeholder {
    color: #9ca3af;
}

.archive-search-input:hover {
    border-color: #d1d5db;
}

.archive-search-input:focus {
    outline: none;
    border-color: #7B2CBF;
    box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.15);
}

.archive-search-hint {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .archive-search-section {
        justify-content: stretch;
    }

    .archive-search-inner {
        max-width: 100%;
    }
}

/* Notifications Grid */
.notifications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.notifications-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.notifications-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.notifications-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Notification Card */
.notification-card{
    margin: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #F8EBFF;
    padding-bottom: 14px;
    justify-content: space-between;
}

.notification-card-content{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.featured-image {
    aspect-ratio: 3 / 2;
    position: relative;
    background-color: #d1d1d1;
    border: 1px solid #7B2CBF;
    border-radius: 16px;
    overflow: hidden;
    border-bottom-width: 3px;
}

.featured-image img,
.featured-image .image-placeholder {
    border-radius: 10px;
}

/* Simulated site background for notification layouts */
.notifal-layout-holder {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.notifal-layout-site {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: linear-gradient(180deg, #e8e9ec 0%, #dfe1e5 100%);
    overflow: hidden;
}

.notifal-layout-cover-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 12px 12px;
    pointer-events: none;
}

.notifal-layout-cover-row {
    height: 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.35);
    width: 100%;
}

.notifal-layout-cover-row:first-child {
    height: 8px;
    max-width: 100%;
    background: rgba(148, 163, 184, 0.4);
}

.notifal-layout-cover-row:nth-child(2) {
    width: 92%;
    height: 24px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.28);
}

.notifal-layout-cover-row--small {
    height: 5px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.3);
    width: 72%;
}

.notifal-layout-cover-row--small:last-of-type {
    width: 85%;
}

.notifal-layout-cover-columns {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex: 1;
    min-height: 0;
}

.notifal-layout-cover-col {
    flex: 1;
    min-width: 0;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.22);
}

.notifal-layout-cover-col:first-child {
    flex: 0.85;
}

.notifal-layout-cover-col:last-child {
    flex: 1.1;
}

.notifal-layout-feature {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px 10px;
    box-sizing: border-box;
}

.notifal-layout-feature .image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 60px;
    background-color: #d1d1d1;
    border: 1px solid rgba(123, 44, 191, 0.4);
}

/* Popup: centered, overlay behind popup */
.featured-image.notifal-layout--popup .notifal-layout-feature::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 0;
}

.featured-image.notifal-layout--popup .notifal-layout-feature img,
.featured-image.notifal-layout--popup .notifal-layout-feature .image-placeholder {
    max-width: 78%;
    max-height: 78%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* Floating bar: full width, flush to top */
.featured-image.notifal-layout--floating-bar .notifal-layout-feature {
    align-items: flex-start;
    justify-content: center;
    padding: 0 0 10px 0;
}

.featured-image.notifal-layout--floating-bar .notifal-layout-feature img,
.featured-image.notifal-layout--floating-bar .notifal-layout-feature .image-placeholder {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 38%;
    min-height: 28px;
    object-fit: contain;
    object-position: top center;
    border-radius: 0;
}

/* Floating box: bottom-left */
.featured-image.notifal-layout--floating-box .notifal-layout-feature {
    align-items: flex-end;
    justify-content: flex-start;
}

.featured-image.notifal-layout--floating-box .notifal-layout-feature img,
.featured-image.notifal-layout--floating-box .notifal-layout-feature .image-placeholder {
    max-width: 60%;
    max-height: 68%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: bottom left;
}

.notification-title{
     line-height: 26px !important;
     font-size: 16px !important;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge{
    background-color: #ECC8FF;
    color: #1a1a1a;
    border-radius: 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    padding: 2px 13px;
    font-size: 13px;
}

.view-details{
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    margin-top: 20px;
    transition: color 0.3s ease;
}

.view-details:hover {
    color: #7B2CBF;
}


/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.load-more-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #6d28d9;
}

.load-more-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* No Notifications */
.no-notifications {
    text-align: center;
    padding: 60px 20px;
}

.no-notifications p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.reset-filters-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-filters-btn:hover {
    background: #6d28d9;
}

/* Loading States */
.notifications-grid-wrapper.loading {
    position: relative;
}

.notifications-grid-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #e5e5e5;
    border-top: 4px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

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

/* Archive Filters Button (Top of Archive) - Mobile Only */
.archive-filters-btn {
    display: none; /* Hidden by default on desktop */
    align-items: center;
    gap: 8px;
    background: #7B2CBF;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(123, 44, 191, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 20px;
    position: relative;
    font-family: "Raleway", Sans-serif;
}

.archive-filters-btn:hover {
    background: #6d28d9;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.4);
    transform: translateY(-1px);
}

.archive-filters-btn:active {
    transform: translateY(0);
}

.archive-filters-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    flex-shrink: 0;
}

.archive-filter-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Floating Filter Button */
.floating-filter-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    background: #7B2CBF;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(100px);
}

.floating-filter-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.floating-filter-btn:hover {
    background: #6d28d9;
    box-shadow: 0 6px 16px rgba(123, 44, 191, 0.5);
    transform: scale(1.05);
}

.floating-filter-btn:active {
    transform: scale(0.95);
}

.floating-filter-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.floating-filter-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Slide-out Filter Panel */
.filter-slide-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile blur overlay */
@media (max-width: 768px) {
    .filter-slide-panel {
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

.filter-slide-panel.open {
    opacity: 1;
    visibility: visible;
}

.filter-slide-content {
    position: absolute;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: white;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.filter-slide-panel.open .filter-slide-content {
    left: 0;
}

.filter-panel-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #F8EBFF;
    padding: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-panel-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    font-family: "Raleway", Sans-serif;
}

.filter-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.filter-panel-close:hover {
    background: #f3f4f6;
}

.filter-panel-close svg {
    width: 24px;
    height: 24px;
    fill: #6b7280;
}

.filter-panel-body {
    padding: 20px;
}

/* Body scroll prevention when filter panel is open */
body.filter-panel-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile Filter Panel (Partial width with blur overlay) */
@media (max-width: 768px) {
    .filter-slide-content {
        width: 320px;
        max-width: 85vw;
        left: -320px;
    }

    .filter-panel-header {
        padding: 16px 20px;
    }

    .filter-panel-title {
        font-size: 18px;
    }

    /* Ensure floating button doesn't interfere with mobile UI */
    .floating-filter-btn {
        bottom: 60px;
        left: 20px;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Hide sidebar on tablet and below */
    .archive-sidebar {
        display: none;
    }

    .archive-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .archive-main-content {
        padding: 30px;
    }

    .notifications-grid[data-columns="3"],
    .notifications-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Show floating button on tablet */
    .floating-filter-btn {
        display: flex;
    }

    /* Show archive filters button on tablet and mobile */
    .archive-filters-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .notifal-marketplace-archive {
        padding: 10px;
    }

    .archive-main-content {
        padding: 20px;
    }

    .notifications-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .card-image {
        height: 160px;
    }

    .card-content {
        padding: 15px;
    }

    .card-meta {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .card-stats {
        order: 2;
    }

    .card-actions {
        order: 1;
    }
}

@media (max-width: 480px) {
    .filter-panel-header {
        padding: 16px;
    }

    .filter-panel-body {
        padding: 16px;
    }

    .filter-sidebar {
        padding: 5px;
    }

    .archive-main-content {
        padding: 15px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-tags {
        gap: 6px;
    }

    .tag {
        font-size: 11px;
        padding: 3px 8px;
    }
}
