/* Banner走馬燈樣式 */

.hero-banner {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-xl);
}

.banner-carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-slide.active {
    opacity: 1;
    transform: translateX(0);
}

.banner-slide.prev {
    transform: translateX(-100%);
}

.banner-slide.next {
    transform: translateX(100%);
}

/* Banner內容覆蓋層 */
.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
    animation: bannerContentSlideUp 0.8s ease-out 0.3s both;
}

@keyframes bannerContentSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.banner-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.banner-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    line-height: 1.5;
}

.banner-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.banner-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 2px solid white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: none;
    backdrop-filter: blur(10px);
}

.banner-btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.banner-btn-primary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.banner-btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.banner-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

/* Banner控制項 */
.banner-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 3;
    pointer-events: none;
}

.banner-arrow {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    font-weight: bold;
}

.banner-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.banner-arrow:active {
    transform: scale(0.95);
}

.banner-arrow.prev {
    font-size: 2rem;
    line-height: 1;
}

.banner-arrow.next {
    font-size: 2rem;
    line-height: 1;
}

/* Banner指示點 */
.banner-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.banner-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.banner-dot.active {
    background: white;
    border-color: white;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 播放控制 */
.banner-play-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 3;
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    font-size: 1rem;
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Banner進度條 */
.banner-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 3;
}

.banner-progress-bar {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Banner管理樣式 */
.banner-management {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.banner-upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--background-alt);
    margin-bottom: 2rem;
}

.banner-upload-area:hover,
.banner-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.upload-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sort-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* Banner列表樣式 */
.banner-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    min-height: 200px;
}

.banner-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--background-alt);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
}

.banner-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.banner-item.dragging {
    opacity: 0.7;
    transform: rotate(2deg);
    z-index: 1000;
}

.banner-drag-handle {
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: grab;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.banner-drag-handle:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.banner-drag-handle:active {
    cursor: grabbing;
}

.banner-thumbnail {
    width: 80px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.banner-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.banner-info {
    flex: 1;
    min-width: 0;
}

.banner-title-input {
    width: 100%;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.banner-title-input:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
}

.banner-subtitle-input {
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.banner-subtitle-input:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
}

.banner-url-input {
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    background: transparent;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.banner-url-input:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
}

.banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.banner-actions .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

/* Banner設定樣式 */
.banner-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.banner-settings .form-group {
    margin-bottom: 0;
}

.banner-settings label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.banner-settings input[type="number"] {
    width: 100px;
}

/* 空Banner狀態 */
.banner-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    background: var(--background-alt);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.banner-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.banner-empty h4 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.banner-empty p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero-banner {
        height: 400px;
        margin-bottom: 2rem;
    }
    
    .banner-title {
        font-size: 2.5rem;
    }
    
    .banner-subtitle {
        font-size: 1.1rem;
    }
    
    .banner-content {
        padding: 1rem;
    }
    
    .banner-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .banner-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .banner-controls {
        padding: 0 1rem;
    }
    
    .banner-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .banner-dots {
        bottom: 1rem;
    }
    
    .banner-dot {
        width: 10px;
        height: 10px;
    }
    
    .banner-play-controls {
        top: 1rem;
        right: 1rem;
    }
    
    .play-pause-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .banner-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .banner-thumbnail {
        width: 100%;
        height: 120px;
        align-self: center;
        max-width: 200px;
    }
    
    .banner-actions {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .banner-settings {
        grid-template-columns: 1fr;
    }
    
    .banner-upload-area {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        height: 300px;
        border-radius: var(--radius-md);
    }
    
    .banner-title {
        font-size: 2rem;
    }
    
    .banner-subtitle {
        font-size: 1rem;
    }
    
    .banner-controls {
        padding: 0 0.5rem;
    }
    
    .banner-arrow {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .banner-dots {
        gap: 0.5rem;
    }
    
    .banner-dot {
        width: 8px;
        height: 8px;
    }
    
    .banner-management {
        padding: 1rem;
    }
    
    .banner-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .upload-text {
        font-size: 1rem;
    }
    
    .sort-hint {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* Banner載入動畫 */
@keyframes bannerShimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.banner-loading {
    height: 500px;
    background: linear-gradient(
        90deg,
        var(--background-alt) 0%,
        var(--border-light) 50%,
        var(--background-alt) 100%
    );
    background-size: 1000px 100%;
    animation: bannerShimmer 2s infinite linear;
    border-radius: var(--radius-lg);
}

/* Banner過渡效果 */
.banner-slide.fade-in {
    animation: bannerFadeIn 0.6s ease-in-out;
}

.banner-slide.fade-out {
    animation: bannerFadeOut 0.6s ease-in-out;
}

@keyframes bannerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bannerFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.banner-slide.slide-left {
    animation: bannerSlideLeft 0.6s ease-in-out;
}

.banner-slide.slide-right {
    animation: bannerSlideRight 0.6s ease-in-out;
}

@keyframes bannerSlideLeft {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes bannerSlideRight {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 無障礙性增強 */
@media (prefers-reduced-motion: reduce) {
    .banner-slide,
    .banner-content,
    .banner-arrow,
    .banner-dot,
    .play-pause-btn {
        transition: none;
        animation: none;
    }
    
    .banner-progress-bar {
        transition: none;
    }
}

/* 高對比度模式 */
@media (prefers-contrast: high) {
    .banner-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .banner-arrow,
    .banner-dot,
    .play-pause-btn {
        background: rgba(0, 0, 0, 0.8);
        border-color: white;
    }
    
    .banner-btn {
        border-width: 3px;
    }
}