/* --- Explore Header --- */
.explore-header {
    margin-bottom: 2rem;
    text-align: center;
}

.explore-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .explore-header h1 {
    background: linear-gradient(135deg, #000000 0%, #505050 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.explore-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Explore Filters --- */
.explore-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .search-bar input {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

.filter-select {
    padding: 0.8rem 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
}

[data-theme="light"] .filter-select {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

[data-theme="light"] .filter-select option {
    background-color: #ffffff;
    color: var(--text-main);
}

/* --- Voices List --- */
/* --- Voices List (Grid) --- */
.voices-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 1200px) {
    .voices-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .voices-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .voices-list {
        grid-template-columns: 1fr;
    }
}

/* --- Voice Card Item --- */
.voice-list-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.6rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 0.4rem;
}

.voice-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
    border-color: rgba(122, 92, 255, 0.4);
}

[data-theme="light"] .voice-list-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

[data-theme="light"] .voice-list-item:hover {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* Card Top (Horizontal Layout) */
.voice-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

.voice-avatar-container {
    position: relative;
    width: 50px;
    height: 50px;
    min-width: 50px;
    max-width: 50px;
    flex: 0 0 50px;
    border-radius: 50%;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .voice-avatar-container {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        flex: 0 0 48px;
    }
}

@media (max-width: 768px) {
    .voice-avatar-container {
        width: 46px;
        height: 46px;
        min-width: 46px;
        max-width: 46px;
        flex: 0 0 46px;
    }
}

.voice-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-list-item:hover .play-overlay {
    opacity: 1;
}

.play-overlay .play-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transform: scale(0.8);
    transition: transform 0.2s;
}

.voice-list-item:hover .play-overlay .play-btn {
    transform: scale(1);
}

.play-overlay .play-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.voice-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    overflow: hidden;
    width: 100%;
}

.voice-title {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.voice-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

[data-theme="light"] .voice-name {
    color: #111111;
}

.voice-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.voice-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.1rem;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
}

.voice-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 100px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

[data-theme="light"] .voice-tag {
    border-color: rgba(0,0,0,0.1);
}

/* Actions Bottom */
.voice-card-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
    padding-top: 0.2rem;
    width: 100%;
}

.voice-stats {
    display: flex;
    gap: 0.8rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.voice-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.voice-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.share-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.share-btn:hover {
    color: var(--primary);
}

.btn-use-voice {
    background: var(--gradient-brand);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-use-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-use-voice {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-use-voice:hover {
    background: #f8fafc;
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
}



/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .explore-header h1 {
        font-size: 1.8rem;
    }
    
    .explore-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar, .filter-select {
        max-width: 100%;
        width: 100%;
    }
    
    .voice-list-item {
        flex-wrap: wrap;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .voice-info {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .voice-waveform {
        flex: 1;
        justify-content: flex-start;
        padding: 0;
    }
    
    .waveform-svg {
        max-width: 100px;
    }
    
    .voice-actions-right {
        flex: 1;
        justify-content: flex-end;
    }
}

/* --- Desktop Refinements for Filters --- */
@media (min-width: 769px) {
    .explore-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        padding: 0.3rem 0.5rem;
        border-radius: 999px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        margin-bottom: 2rem;
        gap: 0;
    }
    
    .explore-filters .search-bar {
        max-width: none;
        flex: 1;
    }
    
    .explore-filters .search-bar input {
        border: none;
        background: transparent;
        box-shadow: none;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    [data-theme="light"] .explore-filters .search-bar input {
        background: transparent;
        border: none;
    }
    
    .explore-filters .search-bar input:focus {
        background: transparent;
    }
    
    .explore-filters .custom-dropdown {
        width: auto;
        min-width: 180px;
    }
    
    .explore-filters .custom-dropdown .dropdown-trigger {
        background: transparent;
        border: none;
        border-left: 1px solid var(--glass-border);
        border-radius: 0;
        padding: 0.6rem 1.2rem;
    }

    [data-theme="light"] .explore-filters .custom-dropdown .dropdown-trigger {
        background: transparent;
        border-left-color: rgba(0,0,0,0.1);
    }
    
    .explore-filters .custom-dropdown .dropdown-trigger:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    [data-theme="light"] .explore-filters .custom-dropdown .dropdown-trigger:hover {
        background: rgba(0, 0, 0, 0.02);
    }
    
    /* Round edges for the last dropdown to match the pill container */
    .explore-filters .custom-dropdown:last-child .dropdown-trigger {
        border-top-right-radius: 999px;
        border-bottom-right-radius: 999px;
    }
}


.fav-btn.is-fav i {
    color: #ff4757;
}
.fav-btn i {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s;
}
.fav-btn.animate-pulse i {
    transform: scale(1.4);
}

/* === FIX RESPONSIVENESS FOR FAVORITES === */
.explore-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

@media (max-width: 768px) {
    .explore-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem;
    }

}
/* Desktop refinements for favorites */
@media (min-width: 769px) {
    .explore-header {
        text-align: left;
    }
    .explore-header-top {
        align-items: center;
    }
}
