/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

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

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

/* Main content */
main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #667eea;
}

.section-description {
    color: #666;
    margin-bottom: 20px;
}

/* Players list */
.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.player-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.player-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #333;
}

.player-controls {
    display: flex;
    gap: 10px;
}

.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.control-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.control-group select:hover {
    border-color: #667eea;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Action section */
.action-section {
    text-align: center;
    padding: 20px 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Results section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.btn-export:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-export:active:not(:disabled) {
    transform: translateY(0);
}

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

.results-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.result-entry {
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 20px;
    background: #f8f9ff;
}

.result-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-timestamp {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.result-export-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-export-small {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-export-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(40, 167, 69, 0.4);
}

.btn-export-small:active {
    transform: translateY(0);
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.team-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.team-card h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.team-players {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-player {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name-in-team {
    font-weight: 600;
    color: #333;
}

.player-position-level {
    font-size: 0.85rem;
    color: #666;
}

.player-move-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.player-move-control label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.move-player-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    flex: 1;
}

.move-player-select:hover {
    border-color: #667eea;
}

.move-player-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 20px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .export-buttons {
        width: 100%;
    }
    
    .btn-export {
        flex: 1;
        min-width: 120px;
    }
    
    .result-entry-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-export-buttons {
        width: 100%;
    }
    
    .btn-export-small {
        flex: 1;
        min-width: 100px;
    }
}
