/* Pickleball Coach App - Styles */

:root {
    --primary-color: #FF6B35;
    --primary-dark: #E55A2B;
    --secondary-color: #1E3A5F;
    --bg-color: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFAFA;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #FFF5F0;
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #FFF5F0;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.upload-content p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-content small {
    color: var(--text-light);
}

/* Video Preview */
#video-preview-container {
    margin-top: 20px;
}

#video-preview {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    background: #000;
}

/* Form Elements */
.form-select {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    font-family: inherit;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Slider */
#slider-container {
    padding: 0 10px;
    margin: 20px 0;
}

#video-slider {
    margin-bottom: 10px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

#duration {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary, .btn-secondary {
    width: 100%;
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
    background: #CCC;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    margin-top: 20px;
}

.btn-secondary:hover {
    background: #152D4A;
}

/* Results */
.result-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #F8F9FA;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.result-item h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-item p {
    line-height: 1.8;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #F3F3F3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Players Section */
.players-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.player-card {
    position: relative;
    border: 3px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.player-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.3);
}

.player-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.player-card .player-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 500;
}

.player-card .player-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-card.selected .player-check {
    opacity: 1;
}

.hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Video Controls */
.video-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.video-controls button {
    flex: 1;
    max-width: 200px;
}

/* Error */
.error {
    background: #FFEBEE;
    color: var(--error-color);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 15px;
        font-size: 1rem;
    }
}
