/* RSS APP 嵌入器樣式 */

/* 容器樣式 */
.rss-app-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin: 20px 0;
}

#rss-audio-root {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* 載入動畫 */
.rss-app-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.rss-app-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 旋轉動畫 */
.rss-app-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1DB954;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.rss-app-loading p {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* 錯誤訊息樣式 */
.rss-app-error {
    padding: 40px;
    text-align: center;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 20px 0;
}

.rss-app-error p {
    margin: 10px 0;
    color: #856404;
}

.rss-app-error a {
    color: #856404;
    font-weight: bold;
    text-decoration: underline;
}

.rss-app-error a:hover {
    color: #533f03;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .rss-app-container {
        border-radius: 8px;
        margin: 15px 0;
    }

    #rss-audio-root {
        min-height: 300px;
    }
}

/* 全寬模式 */
.rss-app-container.full-width {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    border-radius: 0;
}

/* 深色模式支援 */
@media (prefers-color-scheme: dark) {
    .rss-app-container {
        background: #1e1e1e;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .rss-app-loading {
        background: rgba(30, 30, 30, 0.95);
    }

    .rss-app-loading p {
        color: #e0e0e0;
    }
}

/* 確保 APP 內容不會溢出 */
.rss-app-container * {
    box-sizing: border-box;
}

/* 平滑捲動 */
.rss-app-container {
    scroll-behavior: smooth;
}

/* 載入完成後的淡入效果 */
#rss-audio-root {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}