/* 樂譜管理系統樣式表 */

/* 基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 標題欄 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

/* 按鈕樣式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #4CAF50;
    color: #fff;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #757575;
    color: #fff;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-2px);
}

.btn-success {
    background: #2196F3;
    color: #fff;
}

.btn-success:hover {
    background: #0b7dda;
    transform: translateY(-2px);
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #da190b;
    transform: translateY(-2px);
}

/* 載入中 */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    font-size: 18px;
    color: #999;
}

/* 樂譜列表 */
.sheets-list {
    padding: 20px;
}

.sheet-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    gap: 20px;
}

.sheet-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.sheet-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.sheet-meta {
    color: #666;
    font-size: 14px;
}

.sheet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 編輯頁面樣式 */
.edit-container {
    padding: 30px;
}

.step-panel {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 30px;
}

.step-panel h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 24px;
}

/* 上傳區域 */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #764ba2;
    background: #f5f5ff;
}

.upload-label {
    cursor: pointer;
    display: block;
}

.upload-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 18px;
    color: #666;
}

/* 上傳進度 */
.upload-progress {
    padding: 30px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

#progressText {
    font-size: 16px;
    color: #666;
}

/* 表單樣式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 16px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* 頁面容器 */
.pages-container {
    margin-top: 30px;
}

.pages-container h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.pages-preview {
    display: grid;
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

/* 頁面項目 */
.page-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

.page-item:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.page-preview {
    position: relative;
}

.page-preview img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.page-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.seconds-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
}

.seconds-input:focus {
    outline: none;
    border-color: #667eea;
}

.page-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-nav {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: #fff;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background: #667eea;
    color: #fff;
}

/* 表單操作 */
.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* 響應式設計 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    header h1 {
        font-size: 24px;
    }

    .sheet-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .sheet-actions {
        width: 100%;
        justify-content: space-between;
    }

    .page-item {
        grid-template-columns: 1fr;
    }

    .page-preview img {
        max-width: 100%;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* iPad 縱向模式優化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }

    body {
        padding: 0;
    }

    .page-preview img {
        max-width: 400px;
    }

    /* 全螢幕播放優化 */
    .play-screen img {
        width: 100vw;
        height: 100vh;
        object-fit: contain;
    }
}

/* 全螢幕播放模式 */
@media (orientation: portrait) {
    .play-screen img {
        max-width: 100vw;
        max-height: 100vh;
    }
}

@media (orientation: landscape) {
    .play-screen img {
        max-width: 100vw;
        max-height: 100vh;
    }
}

/* 自定義滾動條 */
.pages-preview::-webkit-scrollbar {
    width: 10px;
}

.pages-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.pages-preview::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.pages-preview::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}
