/**
 * IRL Theme Browser - Modern Explore Page Styles
 * Transforms the 2010 WordPress blog feel into a modern, polished interface
 */

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.irl-theme-browser {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   HEADER & INTRO
   ======================================== */

.irl-browser-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 24px 0;
}

.irl-browser-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
    line-height: 1.2;
}

.irl-browser-intro {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.irl-browser-intro strong {
    color: #1e293b;
    font-weight: 600;
}

/* ========================================
   ACTIVE FILTERS CHIPS
   ======================================== */

.irl-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e8edff;
    min-height: 48px;
    align-items: center;
}

.irl-active-filters:empty {
    display: none;
}

.irl-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #7d92ff 0%, #6b7ff0 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(125, 146, 255, 0.2);
    transition: all 0.2s ease;
}

.irl-filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(125, 146, 255, 0.3);
}

.irl-remove-filter {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.irl-remove-filter:hover {
    background: rgba(255, 255, 255, 0.5);
}

.irl-clear-all-filters {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.irl-clear-all-filters:hover {
    border-color: #ff7d92;
    color: #ff7d92;
    background: rgba(255, 125, 146, 0.05);
}

/* ========================================
   FILTER SECTIONS
   ======================================== */

.irl-theme-browser-filters {
    margin: 0 0 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.irl-filter-section {
    background: white;
    border: 2px solid #e8edff;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
}

.irl-filter-section:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(125, 146, 255, 0.08);
}

.irl-filter-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #e8edff;
}

/* ========================================
   FILTER OPTIONS (PILL BUTTONS)
   ======================================== */

.irl-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px;
}

.irl-filter-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    background: white;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    user-select: none;
    text-align: center;
}

.irl-filter-option:last-child {
    border-bottom: none;
}

.irl-filter-option input[type="checkbox"] {
    display: none;
}

.irl-filter-option span {
    width: 100%;
}

.irl-filter-option:hover {
    background: #f0f4ff;
    color: #7d92ff;
}

/* Active state when checkbox is checked */
.irl-filter-option:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #7d92ff 0%, #6b7ff0 100%);
    color: white;
    font-weight: 600;
}

.irl-filter-option:has(input[type="checkbox"]:checked):hover {
    background: linear-gradient(135deg, #6b7ff0 0%, #5a6ee0 100%);
}

/* Level color indicators */
.irl-filter-option[data-level="start-here"],
.irl-filter-option[data-level="start_here"] {
    border-left: 5px solid #7dffea;
}

.irl-filter-option[data-level="beginner"] {
    border-left: 5px solid #7dffea;
}

.irl-filter-option[data-level="intermediate"] {
    border-left: 5px solid #a97dff;
}

.irl-filter-option[data-level="delf"] {
    border-left: 5px solid #ffa97d;
}

.irl-filter-option[data-level="dalf"] {
    border-left: 5px solid #ff7d92;
}

.irl-filter-option[data-level="start-here"]:has(input:checked),
.irl-filter-option[data-level="start_here"]:has(input:checked),
.irl-filter-option[data-level="beginner"]:has(input:checked),
.irl-filter-option[data-level="intermediate"]:has(input:checked),
.irl-filter-option[data-level="delf"]:has(input:checked),
.irl-filter-option[data-level="dalf"]:has(input:checked) {
    border-left-color: rgba(255, 255, 255, 0.4);
}

/* Grammar section matches other sections now */
.irl-filter-section.filter-grammar {
    /* No special styling needed - matches other sections */
}

/* ========================================
   SUBMIT BUTTON (STICKY)
   ======================================== */

.irl-submit-container {
    grid-column: 1 / -1;
    position: sticky;
    bottom: 20px;
    z-index: 100;
    margin-top: 24px;
    text-align: center;
    padding: 20px 0;
    background: linear-gradient(to top, rgba(248,250,252,1) 0%, rgba(248,250,252,1) 70%, rgba(248,250,252,0) 100%);
}

.irl-submit-button {
    display: inline-block;
    padding: 20px 60px;
    background: linear-gradient(135deg, #7d92ff 0%, #6b7ff0 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(125, 146, 255, 0.4);
    transition: all 0.3s ease;
    min-width: 320px;
    letter-spacing: 0.3px;
}

.irl-submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #6b7ff0 0%, #5a6ee0 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(125, 146, 255, 0.5);
}

.irl-submit-button:active:not(:disabled) {
    transform: translateY(-1px);
}

.irl-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.irl-submit-button .result-count {
    font-weight: 500;
    opacity: 0.9;
}

.irl-reset-button {
    display: inline-block;
    padding: 16px 32px;
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-left: 16px;
}

.irl-reset-button:hover {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   RESULTS GRID (existing classes maintained)
   ======================================== */

.esirl-series-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 18px;
}

/* ========================================
   PAGINATION
   ======================================== */

.irl-theme-browser-pagination {
    margin-top: 32px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 20px 0;
}

.irl-theme-browser-pagination .button {
    padding: 12px 24px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.irl-theme-browser-pagination .button:hover {
    border-color: #7d92ff;
    color: #7d92ff;
    background: #f0f4ff;
}

.irl-theme-browser-pagination span {
    color: #64748b;
    font-size: 14px;
}

/* ========================================
   LOADING STATE
   ======================================== */

.irl-theme-browser.loading .irl-filter-section {
    pointer-events: none;
    opacity: 0.6;
}

.irl-theme-browser.loading .irl-submit-button::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

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

@media (max-width: 1024px) {
    .irl-theme-browser-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .irl-theme-browser-filters {
        grid-template-columns: 1fr;
    }

    .irl-filter-section h3 {
        font-size: 15px;
        padding: 16px;
    }

    .irl-filter-options {
        padding: 12px;
    }

    .irl-filter-option {
        padding: 12px 16px;
        font-size: 13px;
    }

    .irl-submit-button {
        width: 100%;
        min-width: auto;
        padding: 16px 24px;
        font-size: 16px;
    }

    .irl-reset-button {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }

    .irl-submit-container {
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px;
        background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 80%, rgba(255,255,255,0) 100%);
        margin: 0;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.irl-hide {
    display: none !important;
}

.irl-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
