/* Advice Modal */
.advice-modal .advice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
}

.advice-modal .get-app-image {
        max-width: 80%;
}

.advice-title {
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.advice-title .text-dialogue-blue {
    color: #3C4BFB;
    font-weight: 600;
}

.advice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.advice-btn {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, opacity 0.2s;
}

.advice-btn:hover {
    transform: scale(1.02);
}

.advice-btn-primary {
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    color: #ffffff;
}

.advice-btn-primary:hover {
    opacity: 0.9;
}

.advice-btn-secondary {
    background-color: #f5f5f5;
    color: #555;
}

.advice-btn-secondary:hover {
    background-color: #eee;
}

.advice-textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #eee;
    border-radius: 12px;
    resize: vertical;
    margin-bottom: 1.5rem;
    min-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

.advice-textarea:focus {
    border-color: #3C4BFB;
}

.advice-history-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
}

.advice-history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s;
}

.advice-history-item:hover {
    background-color: #f9f9f9;
}

.advice-history-text {
    flex: 1;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.advice-history-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}

.advice-history-delete:hover {
    color: #c33;
}

/* Episode Overview collapsible */
.episode-overview-row {
    width: 100%;
    margin-bottom: 1rem;
}

.episode-overview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition: background-color 0.15s;
}

.episode-overview-header:hover {
    background: #eee;
}

.episode-overview-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
    color: #888;
}

.episode-overview-row.expanded .episode-overview-arrow {
    transform: rotate(90deg);
}

.episode-overview-body {
    display: none;
    padding: 0.75rem 1rem;
}

.episode-overview-row.expanded .episode-overview-body {
    display: block;
}

.episode-overview-spinner {
    display: none;
    width: 24px;
    height: 24px;
    border: 3px solid #eee;
    border-top-color: #3C4BFB;
    border-radius: 50%;
    animation: adviceOverviewSpin 0.7s linear infinite;
    margin: 0.5rem auto;
}

.episode-overview-spinner.visible {
    display: block;
}

@keyframes adviceOverviewSpin {
    to { transform: rotate(360deg); }
}

.episode-overview-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
    text-align: left;
}

.episode-overview-list li {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

/* Personalized Advice Button (player header) */
.personalized-advice-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.personalized-advice-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.personalized-advice-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.personalized-advice-btn.flash {
    animation: adviceBtnFlash 1s ease-in-out infinite;
}

@keyframes adviceBtnFlash {
    0%, 100% { color: #333; transform: scale(1); }
    50% { color: #3C4BFB; transform: scale(1.2); }
}

/* Advice Side Panel */
.advice-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.advice-panel-overlay.show {
    display: block;
    opacity: 1;
}

.advice-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh;
    background: #fff;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.advice-panel.show {
    transform: translateX(0);
}

.advice-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.advice-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.advice-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    margin-right: 0.5rem;
}

.advice-action-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.advice-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.advice-action-btn.active {
    color: #3C4BFB;
}

.advice-action-btn.active svg {
    fill: #3C4BFB;
}

.advice-feedback-box {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.advice-feedback-textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid #eee;
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.advice-feedback-textarea:focus {
    border-color: #3C4BFB;
}

.advice-feedback-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.advice-feedback-submit {
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.advice-feedback-submit:hover {
    opacity: 0.9;
}

.advice-feedback-cancel {
    background: #f5f5f5;
    color: #555;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.advice-feedback-cancel:hover {
    background: #eee;
}

.advice-panel-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    line-height: 1;
    transition: background-color 0.2s;
}

.advice-panel-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.advice-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
}

.advice-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1.5rem;
    color: #888;
    font-size: 0.95rem;
}

.advice-panel-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #3C4BFB;
    border-radius: 50%;
    animation: adviceOverviewSpin 0.7s linear infinite;
}

@media (min-width: 768px) {
    .advice-panel {
        width: 60%;
    }
}

.advice-item {
    margin-bottom: 1.25rem;
}

.advice-item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.advice-item-text {
    color: #333;
    line-height: 1.7;
}

.advice-episode-header {
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    padding: 0.75rem 1rem 0.25rem;
}

.advice-panel-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0.5rem 1rem;
}

.advice-history-tile {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s;
}

.advice-history-tile:hover {
    background-color: #f5f5f5;
}

.advice-history-tile-text {
    color: #333;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advice-new-btn {
    display: block;
    width: calc(100% - 2rem);
    margin: 1.25rem 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #3C4BFB 0%, #667eea 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.advice-new-btn:hover {
    opacity: 0.9;
}

.advice-back-btn {
    background: none;
    border: none;
    color: #3C4BFB;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0 0 1rem 0;
    font-weight: 500;
}

.advice-back-btn:hover {
    text-decoration: underline;
}

/* Advice Panel Player Controls */
.advice-panel-player {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.advice-panel-player-info {
    min-width: 0;
    flex: 1;
    margin-right: 1rem;
}

.advice-panel-player-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.advice-panel-player-title {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advice-panel-play-pause-btn {
    background: #3C4BFB;
    color: #fff;
    border: 2px solid #3C4BFB;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.advice-panel-play-pause-btn:hover {
    background: #2c3e50;
}
@media (min-width: 768px) {
    .advice-modal .advice-content {
        padding: 3rem;
        max-width: 500px;
    }

    .advice-title {
        font-size: 1.5rem;
    }
}

.advice-panel-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    line-height: 1.6;
}
