/* Audiobooks Section Styles */
.audiobooks-section {
    padding: 20px 40px;
    animation: fadeIn 0.5s ease;
}

.audiobooks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-container-audiobooks {
    position: relative;
    width: 300px;
}

.search-container-audiobooks input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.search-container-audiobooks input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #f97316;
    outline: none;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
}

.search-container-audiobooks button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

/* Audiobooks Grid */
.audiobooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.audiobook-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.audiobook-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(249, 115, 22, 0.4);
}

.audiobook-poster {
    position: relative;
    width: 100%;
    height: 270px;
    overflow: hidden;
}

.audiobook-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.audiobook-card:hover .audiobook-poster img {
    transform: scale(1.1);
}

.audiobook-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60%;
    height: 55%;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 50%, #4f46e5 100%);
    border-top-left-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.badge-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    backdrop-filter: blur(10px);
}

.badge-icon svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.badge-title {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.audiobook-info {
    padding: 15px;
}

.audiobook-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

/* Loader */
.audiobooks-loader {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

/* Load More Button */
.audiobooks-load-more {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 25px;
    color: #f97316;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.load-more-btn:hover:not(:disabled) {
    background: #f97316;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.load-more-btn svg {
    width: 20px;
    height: 20px;
}

/* Modal Styles */
.audiobook-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.audiobook-modal.active {
    display: flex;
}

.audiobook-modal-content {
    background: #121218;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.audiobook-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.audiobook-modal-close:hover {
    color: #fff;
}

.audiobook-modal-header {
    display: flex;
    padding: 30px;
    gap: 30px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
}

.modal-poster {
    width: 200px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
}

.chapters-container {
    padding: 0 30px 30px;
    flex: 1;
    overflow-y: auto;
}

.chapters-container h3 {
    margin-bottom: 15px;
    color: #f97316;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.audiobook-modal .chapters-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audiobook-modal .chapter-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
}

.audiobook-modal .chapter-item:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: #f97316;
}

.audiobook-modal .chapter-number {
    width: 40px;
    height: 40px;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #f97316;
    flex-shrink: 0;
}

.audiobook-modal .chapter-name {
    flex: 1;
    font-size: 0.95rem;
    color: #fff !important;
    font-weight: 500;
    min-width: 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.audiobook-modal .chapter-duration {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    display: block !important;
    visibility: visible !important;
}

/* Player Styles */
.audiobook-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.audiobook-player.active {
    display: flex;
}

.player-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.player-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 30px;
    cursor: pointer;
    transition: color 0.3s;
}

.player-close:hover {
    color: #fff;
}

.player-cover-container {
    width: 100%;
    margin-bottom: 30px;
}

.player-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

.player-info {
    text-align: center;
    margin-bottom: 30px;
}

.player-info h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.player-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.player-progress-container {
    margin-bottom: 30px;
}

.player-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
    position: relative;
}

.player-progress {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.player-time {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.player-btn:hover {
    background: rgba(249, 115, 22, 0.3);
    transform: scale(1.1);
}

.player-btn svg {
    width: 24px;
    height: 24px;
}

.player-btn-large {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.player-btn-large:hover {
    background: linear-gradient(135deg, #fb923c, #f97316);
    transform: scale(1.15);
}

.player-btn-large svg {
    width: 32px;
    height: 32px;
}

.player-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.player-volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.player-btn-small {
    width: 40px;
    height: 40px;
}

.player-btn-small svg {
    width: 20px;
    height: 20px;
}

.player-volume-slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.player-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #f97316;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.player-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.player-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #f97316;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.player-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.player-volume-slider::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #f97316 0%, #f97316 var(--volume-percent, 100%), rgba(255, 255, 255, 0.1) var(--volume-percent, 100%), rgba(255, 255, 255, 0.1) 100%);
    height: 6px;
    border-radius: 3px;
}

.player-volume-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
}

.player-volume-slider::-moz-range-progress {
    background: #f97316;
    height: 6px;
    border-radius: 3px;
}

.player-speed {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.player-speed:focus {
    outline: none;
    border-color: #f97316;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
