/* Player page specific styles */
.player-page {
    background: #ffffff;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: auto;
    overscroll-behavior: auto;
}

.player-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 220px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.player-page::after {
    content: '';
    position: fixed;
    top: -20px;
    right: 0;
    width: 240px;
    height: 240px;
    background-image: none;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

/* Player header */
.player-header {
    background-color: #ffffff;
    background-image:
        radial-gradient(circle at top left, #C5E67380 0%, transparent 20%),
        radial-gradient(circle at top right, #D4B9FB80 0%, transparent 50%);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-button {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.75rem;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.share-button {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.share-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.share-button:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.header-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    pointer-events: none;
}

.header-book-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-author-name {
    font-size: 0.85rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.15rem;
}

.header-episode-title {
    font-size: 0.9rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.25rem;
}

/* Player container */
.player-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.player-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.player-cover-wrapper {
    position: relative;
    width: 179px;
    height: 269px;
}

.player-cover-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at center, #C5E67380 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    filter: blur(30px);
}

.player-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.2);
    background-color: #e0e0e0;
    position: relative;
    z-index: 1;
}

/* Transcript display */
.transcript-display {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.transcript-display.hidden {
    display: none;
}

.transcript-display .current-word {
    color: #3C4BFB;
    font-weight: 700;
    transition: color 0.15s ease;
}

/* Player controls */
.player-controls {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.seek-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 1.5rem;
    cursor: pointer;
    position: relative;
}

.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60, 75, 251, 0.4);
    margin-top: -6px;
}

.seek-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(60, 75, 251, 0.4);
    margin-top: 0;
}

.seek-bar::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right,
        #ffcccb 0%,
        #ffcccb var(--seek-floor-width, 0%),
        #3C4BFB var(--seek-floor-width, 0%),
        #3C4BFB var(--seek-before-width, 0%),
        #e0e0e0 var(--seek-before-width, 0%),
        #e0e0e0 var(--seek-limit-width, 100%),
        #ffcccb var(--seek-limit-width, 100%),
        #ffcccb 100%);
}

.seek-bar::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
}

.seek-bar::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: #3C4BFB;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 75%;
    margin: 0 auto;
}

.control-btn {
    background: none;
    border: none;
    color: #3C4BFB;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

.rewind-btn,
.forward-btn {
    color: #444;
    min-width: 36px;
}

.skip-text {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.nav-btn {
    color: #444;
    padding: 0.25rem;
}

.control-btn:hover {
    background-color: rgba(60, 75, 251, 0.1);
    transform: scale(1.1);
}

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

.play-pause-btn {
    background: none;
    color: #3C4BFB;
    width: 64px;
    height: 64px;
}

.play-pause-btn svg {
    filter: drop-shadow(0 2px 4px rgba(60, 75, 251, 0.3));
}

.play-pause-btn:hover {
    transform: scale(1.05);
}

.play-pause-btn:hover svg {
    filter: drop-shadow(0 12px 12px rgba(60, 75, 251, 0.4));
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    .player-header {
        padding: 1.25rem;
        justify-content: center;
    }

    .player-header::before {
        content: '';
        max-width: 600px;
        width: 100%;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        pointer-events: none;
    }

    .player-header > * {
        position: relative;
        z-index: 1;
    }

    .back-button,
    .share-button,
    .personalized-advice-btn,
    .header-info {
        max-width: 600px;
    }

    .player-header .back-button {
        position: absolute;
        left: 50%;
        transform: translateX(calc(-300px - 0.5rem));
    }

    .player-header .share-button {
        position: absolute;
        right: 50%;
        transform: translateX(calc(300px + 0.5rem));
    }

    .player-header .personalized-advice-btn {
        position: absolute;
        right: 50%;
        transform: translateX(calc(300px + 3rem));
    }

    .player-header .header-info {
        margin: 0 auto;
    }

    .header-book-title {
        font-size: 1.25rem;
    }

    .header-author-name {
        font-size: 0.95rem;
    }

    .header-episode-title {
        font-size: 1rem;
    }

    .player-cover-wrapper {
        width: 205px;
        height: 307px;
    }

    .player-controls {
        padding: 2rem;
    }

    .control-buttons {
        gap: 3rem;
    }

    .play-pause-btn {
        width: 56px;
        height: 56px;
    }

    .play-pause-btn svg {
        width: 48px;
        height: 48px;
    }

    .transcript-display {
        font-size: 1.2rem;
        padding: 1.25rem;
        min-height: 90px;
    }
}

/* Desktop screens */
@media (min-width: 1024px) {
    .player-container {
        padding: 2.5rem 1rem;
    }

    .player-cover-wrapper {
        width: 230px;
        height: 346px;
    }
}

/* Loading spinner */
.player-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    gap: 1rem;
}

.player-loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #3C4BFB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #666;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Get App button */
.get-app-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.get-app-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: none;
    border: none;
    color: #666;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s;
}

.get-app-button:hover {
    color: #3C4BFB;
}

.get-app-button:active {
    transform: translateY(0);
}

.get-app-button svg {
    flex-shrink: 0;
}

/* Share Modal Styles */
.share-modal-content {
    max-width: 500px;
}

.share-book-name {
    text-align: center;
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.share-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.share-app-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-via-apps-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(60, 75, 251, 0.3);
    margin-bottom: 0.75rem;
}

.share-via-apps-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 75, 251, 0.4);
}

.share-via-apps-btn:active {
    transform: translateY(0);
}

.copy-link-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: #f5f5f5;
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s, opacity 0.2s;
}

.copy-link-btn:hover {
    background-color: #e8e8e8;
    transform: translateY(-1px);
}

.copy-link-btn:active {
    transform: translateY(0);
}

/* Minutes Remaining Widget */
.minutes-text {
    font-size: 11px;
    font-weight: 600;
    fill: #333;
}

@media (min-width: 768px) {
    .share-book-name {
        font-size: 1.1rem;
    }

    .share-app-image {
        max-height: 350px;
    }
}
