/* 上傳頁面樣式 */

.upload-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.upload-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-header p {
    color: var(--color-black);
    opacity: 0.7;
}

.upload-area {
    border: 3px dashed var(--color-purple);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    background: var(--color-white);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: var(--color-blue);
    background: rgba(187, 145, 255, 0.05);
}

.upload-area.dragover {
    border-color: var(--color-blue);
    background: rgba(73, 123, 255, 0.1);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    color: var(--color-black);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--color-black);
    opacity: 0.6;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-white);
    border: 2px solid var(--color-purple);
    cursor: pointer;
    transition: transform 0.2s ease;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.image-preview-item:hover {
    transform: scale(1.05);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-item .delete-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.image-preview-item .delete-btn:hover {
    background: rgba(255, 107, 107, 1);
}

.image-count {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-black);
    opacity: 0.7;
}

.upload-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
    color: var(--color-white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-black);
    border: 2px solid var(--color-purple);
}

.btn-secondary:hover {
    background: var(--color-purple);
    color: var(--color-white);
}

.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(187, 145, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-purple), var(--color-blue));
    transition: width 0.3s ease;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background: var(--color-white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.hidden {
    display: none;
}

/* 最近遊戲區塊樣式 */
.recent-games-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-white);
    border: 2px solid var(--color-purple);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-games-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-black);
    text-align: center;
}

.recent-games-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-game-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(187, 145, 255, 0.05);
    border: 2px solid var(--color-purple);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.recent-game-item:hover {
    background: rgba(187, 145, 255, 0.1);
    border-color: var(--color-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recent-game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recent-game-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-black);
}

.recent-game-date {
    font-size: 0.85rem;
    color: var(--color-black);
    opacity: 0.6;
}

.recent-game-play-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
    color: var(--color-white);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.recent-game-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(73, 123, 255, 0.4);
}

.recent-game-play-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .upload-container {
        padding: 1rem;
    }
    
    .upload-header h1 {
        font-size: 2rem;
    }
    
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .recent-games-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .recent-games-section h2 {
        font-size: 1.25rem;
    }
    
    .recent-game-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .recent-game-play-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .recent-games-section {
        padding: 0.75rem;
    }
    
    .recent-games-section h2 {
        font-size: 1.1rem;
    }
    
    .recent-game-name {
        font-size: 1rem;
    }
    
    .recent-game-date {
        font-size: 0.8rem;
    }
}

