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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-button {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}

.nav-button:hover, .nav-button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.page {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 20px;
}

.page.active {
    display: block;
}

.card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.movie-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.movie-card.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.movie-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

.movie-year {
    color: #666;
    font-size: 1rem;
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.vs-text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.elo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.elo-table th, .elo-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.elo-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.elo-table tr:hover {
    background: #f5f5f5;
}

.file-upload {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #5a6fd8;
    background: #f0f2f5;
}

.file-upload input {
    display: none;
}

.file-upload label {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.upload-header:hover {
    border-bottom-color: #667eea;
}

.upload-header h2 {
    margin: 0;
}

.toggle-icon {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    transition: transform 0.3s ease;
}

.upload-content {
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.upload-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.upload-section-collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h3 {
    margin: 0;
}

.analyze-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.analyze-header h2 {
    margin: 0 0 10px 0;
}

.analyze-header p {
    margin: 0;
}

.history-content {
    max-height: 300px;
    overflow-y: auto;
}

.game-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
}

.game-history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-history-item.edit-mode {
    border-left-color: #ffc107;
}

.game-history-item.edit-mode:hover {
    border-left-color: #dc3545;
}

.game-winner {
    font-weight: 600;
    color: #28a745;
}

.game-loser {
    color: #666;
}

.game-vs {
    color: #667eea;
    font-weight: 600;
    margin: 0 10px;
}

.game-actions {
    display: flex;
    gap: 5px;
}

.game-actions button {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.history-edit-mode .game-history-item {
    cursor: pointer;
}

.history-edit-mode .game-history-item:hover {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.progress-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s ease;
}

.progress-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.hidden {
    display: none;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
        margin-bottom: 5px;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .nav-button {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }
    
    .page {
        padding: 20px;
        margin-top: 15px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .movie-card {
        padding: 20px;
        margin: 10px 0;
    }
    
    .movie-title {
        font-size: 1.3rem;
    }
    
    .vs-text {
        font-size: 1.5rem;
        margin: 10px 0;
    }
    
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .progress-stats {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .progress-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .progress-actions .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .elo-table {
        font-size: 0.9rem;
    }
    
    .elo-table th, .elo-table td {
        padding: 8px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .analyze-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .analyze-header .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .game-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }
    
    .game-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .file-upload {
        padding: 30px 20px;
    }
    
    .upload-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .upload-content {
        padding-top: 15px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .page {
        padding: 15px;
    }
    
    .card {
        padding: 12px;
    }
    
    .movie-card {
        padding: 15px;
    }
    
    .movie-title {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .elo-table {
        font-size: 0.8rem;
    }
    
    .elo-table th, .elo-table td {
        padding: 6px;
    }
    
    .progress-bar {
        height: 15px;
    }
    
    .file-upload {
        padding: 20px 15px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-button {
        width: auto;
        max-width: none;
    }
    
    .comparison-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .progress-header {
        flex-direction: row;
        align-items: center;
    }
    
    .progress-stats {
        flex-direction: row;
        gap: 15px;
    }
    
    .progress-actions {
        flex-direction: row;
        gap: 10px;
    }
    
    .progress-actions .btn {
        width: auto;
        max-width: none;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .movie-card {
        min-height: 60px;
    }
    
    .nav-button {
        min-height: 44px;
    }
    
    .game-history-item {
        min-height: 50px;
    }
} 