/* Finishers list styles (match combinations) */
.finishers-list {
    margin: 2rem 0;
}
.finishers-list h3 {
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
}
#finishers-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}
.finisher-item {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.finisher-text {
    flex: 1;
    font-size: 1rem;
}
/* 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, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen management */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

/* Authentication styles */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.auth-container h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Form styles */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #f0f0f0;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255,255,255,0.15);
}

.input-group input::placeholder {
    color: rgba(255,255,255,0.6);
}

/* Loading state for forms */
.auth-form.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-form.loading button {
    position: relative;
}

.auth-form.loading button::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

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

/* Button styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
    touch-action: manipulation;
}

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

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

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #218838);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    width: 100%;
    max-width: 300px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* App header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.app-header h1 {
    font-size: 1.8rem;
}

/* Tab navigation */
.tab-nav {
    display: flex;
    background: rgba(0,0,0,0.1);
    padding: 0 1rem;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #4CAF50;
    background: rgba(255,255,255,0.1);
}

/* Tab content */
.tab-content {
    flex: 1;
    padding: 2rem;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section styles */
.section {
    background: rgba(255,255,255,0.1);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Training display */
.training-container {
    max-width: 600px;
    margin: 0 auto;
}

.training-display {
    text-align: center;
    margin-bottom: 2rem;
}

.combination-display {
    background: rgba(0,0,0,0.3);
    padding: 2rem;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 2px solid rgba(76, 175, 80, 0.3);
    box-shadow: inset 0 0 20px rgba(76, 175, 80, 0.1);
}

.stats-display {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 1.1rem;
}

/* Training controls */
.training-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* Progress bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

/* Combinations list */
.combinations-list {
    margin: 2rem 0;
}

.combinations-list h3 {
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
}

#combinations-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.combination-item {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.combination-text {
    flex: 1;
    font-size: 1rem;
}

.combination-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Error and message styles */
.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.lockout-message {
    color: #ffa500;
    background: rgba(255, 165, 0, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.success-message {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.hidden {
    display: none !important;
}

/* Range input styling */
input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .app-header h1 {
        font-size: 1.4rem;
    }
    
    .tab-content {
        padding: 1rem;
    }

    .tab-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        display: inline-block;
        min-width: 120px;
        white-space: normal;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .combination-display {
        font-size: 1.2rem;
        padding: 1.5rem;
        min-height: 100px;
    }
    
    .stats-display {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .training-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .training-controls .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .combination-actions {
        flex-direction: column;
    }
    
    .combination-actions .btn {
        width: 100%;
    }
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .tab-btn {
        padding: 1.2rem;
        font-size: 1.1rem;
    }
    
    input, select {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .input-group input {
        background: rgba(255,255,255,0.15);
    }
}

/* Animation for combination changes */
.combination-display.changing {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Accessibility improvements */
.btn:focus,
input:focus,
.tab-btn:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .section {
        border: 1px solid rgba(255,255,255,0.5);
    }
}