/* Mobile Filter Sheet - Bottom Sheet Component */

/* Overlay Backdrop */
.mobile-filter-sheet__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-sheet__overlay.active {
    display: block;
    opacity: 1;
}

/* Bottom Sheet */
.mobile-filter-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 51;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-sheet.active {
    display: block;
    transform: translateY(0);
}

/* Handle for swipe-down */
.mobile-filter-sheet__handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
}

.mobile-filter-sheet__handle:active {
    cursor: grabbing;
}

.mobile-filter-sheet__handle-bar {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
}

/* Header */
.mobile-filter-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-filter-sheet__title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mobile-filter-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-sheet__close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Content */
.mobile-filter-sheet__content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    -webkit-overflow-scrolling: touch;
}

/* Section */
.mobile-filter-sheet__section {
    margin-bottom: 24px;
}

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

.mobile-filter-sheet__section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.mobile-filter-sheet__tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

.mobile-filter-sheet__tab {
    padding: 12px 16px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mobile-filter-sheet__tab:hover {
    background: #e5e7eb;
    color: #374151;
}

.mobile-filter-sheet__tab.active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* Search */
.mobile-filter-sheet__search {
    position: relative;
}

.mobile-filter-sheet__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.mobile-filter-sheet__input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.mobile-filter-sheet__input:focus {
    outline: none;
    border-color: #2563eb;
    background: #f9fafb;
}

/* Sort Options */
.mobile-filter-sheet__sort-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-filter-sheet__radio {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-sheet__radio:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.mobile-filter-sheet__radio input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    accent-color: #2563eb;
}

.mobile-filter-sheet__radio input[type="radio"]:checked + .mobile-filter-sheet__radio-label {
    color: #2563eb;
    font-weight: 600;
}

.mobile-filter-sheet__radio-label {
    flex: 1;
    font-size: 15px;
    color: #374151;
    transition: all 0.2s ease;
}

/* Button Group for Reading Time and other filters */
.mobile-filter-sheet__button-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mobile-filter-sheet__option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-sheet__option-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.mobile-filter-sheet__option-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
    font-weight: 600;
}

.mobile-filter-sheet__option-btn--clear {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    grid-column: span 2;
}

.mobile-filter-sheet__option-btn--clear:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.mobile-filter-sheet__option-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mobile-filter-sheet__option-btn span {
    white-space: nowrap;
}

/* Action Buttons */
.mobile-filter-sheet__actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.mobile-filter-sheet__button {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mobile-filter-sheet__button--primary {
    background: #2563eb;
    color: #ffffff;
}

.mobile-filter-sheet__button--primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mobile-filter-sheet__button--secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.mobile-filter-sheet__button--secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Animation for slide-up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

/* Prevent body scroll when sheet is open */
body.mobile-filter-sheet-open {
    overflow: hidden;
}

/* Desktop - hide mobile sheet */
@media (min-width: 769px) {
    .mobile-filter-sheet,
    .mobile-filter-sheet__overlay {
        display: none !important;
    }
}

/* Small mobile adjustments */
@media (max-width: 375px) {
    .mobile-filter-sheet__tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-filter-sheet__actions {
        grid-template-columns: 1fr;
    }
}

/* Select Dropdown Styles */
.mobile-filter-sheet__select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.mobile-filter-sheet__select:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #f9fafb;
}

.mobile-filter-sheet__select option {
    padding: 12px;
}

/* Tags Styles */
.mobile-filter-sheet__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-filter-sheet__tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mobile-filter-sheet__tag:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

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

.mobile-filter-sheet__tag input[type="checkbox"]:checked + .mobile-filter-sheet__tag-label {
    color: #2563eb;
    font-weight: 600;
}

.mobile-filter-sheet__tag input[type="checkbox"]:checked ~ .mobile-filter-sheet__tag {
    background: #eff6ff;
    border-color: #3b82f6;
}

.mobile-filter-sheet__tag:has(input[type="checkbox"]:checked) {
    background: #eff6ff;
    border-color: #3b82f6;
}

.mobile-filter-sheet__tag:has(input[type="checkbox"]:checked) .mobile-filter-sheet__tag-label {
    color: #2563eb;
    font-weight: 600;
}

.mobile-filter-sheet__tag-label {
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
}
