/* Basis-Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e9ecef;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(77, 171, 247, 0.7);
    color: #fff;
}

.quiz-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Container-Styling */
.question-container,
.result-container,
.chart-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Frage-Header */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.question-number {
    font-weight: bold;
    color: #4dabf7;
    font-size: 1.1rem;
}

.score-display {
    background: rgba(77, 171, 247, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #4dabf7;
}

/* Frage-Text */
.question-text {
    font-size: 1.3rem;
    margin-bottom: 30px;
    line-height: 1.4;
    color: #f8f9fa;
}

/* Antwort-Optionen */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option {
    background: rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 1.1rem;
    text-align: left;
}

.option:hover {
    background: rgba(77, 171, 247, 0.15);
    transform: translateY(-2px);
    border-color: rgba(77, 171, 247, 0.3);
}

.option.selected {
    background: rgba(77, 171, 247, 0.25);
    border-color: #4dabf7;
    box-shadow: 0 0 15px rgba(77, 171, 247, 0.3);
}

.option.correct {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #28a745;
}

.option.incorrect {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #4dabf7, #3b5bdb);
    color: white;
    box-shadow: 0 4px 15px rgba(77, 171, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(77, 171, 247, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #007bff);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* Ergebnis-Container */
.result-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 20px;
    color: #4dabf7;
}

.final-score {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #f8f9fa;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
}

/* Chart Container */
.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 0 auto;
    margin-top: 20px;
}

.chart-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #4dabf7;
}

/* Welcome Page Styles */
.welcome-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.welcome-text {
    font-size: 1.1rem;
    margin: 20px 0;
    line-height: 1.6;
    color: #e9ecef;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.feature-card h3 {
    color: #4dabf7;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature-card p {
    color: #adb5bd;
    font-size: 0.95rem;
}

.start-section {
    text-align: center;
    margin: 30px 0;
}

.username-input {
    margin: 20px 0;
    display: inline-block;
}

.username-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #e9ecef;
}

.username-input input {
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
    width: 300px;
    max-width: 100%;
    transition: border-color 0.3s ease;
}

.username-input input:focus {
    outline: none;
    border-color: #4dabf7;
    box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

/* Highscores */
.highscores-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.highscores-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #4dabf7;
}

.highscores-list {
    margin-top: 20px;
}

.highscore-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    margin: 10px 0;
    border-radius: 8px;
    align-items: center;
    transition: transform 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.highscore-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.1);
}

.highscore-name {
    font-weight: 500;
    color: #e9ecef;
}

.highscore-score {
    color: #ffd43b;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4dabf7;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .question-container,
    .result-container,
    .chart-container {
        padding: 20px;
    }
    
    .question-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option {
        padding: 15px;
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        margin: 5px;
        min-width: 100px;
    }
    
    .chart-wrapper {
        height: 300px;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    .final-score {
        font-size: 1.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .username-input input {
        width: 100%;
    }
    
    .welcome-container,
    .highscores-container {
        padding: 20px;
    }
    
    .feature-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .question-container,
    .result-container,
    .chart-container {
        padding: 15px;
    }
    
    .option {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        margin: 3px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .highscore-item {
        flex-direction: column;
        gap: 5px;
    }
}

/* Accessibility */
.option:focus,
.btn:focus {
    outline: 2px solid #4dabf7;
    outline-offset: 2px;
}

/* Animation für Elemente */
.question-container,
.result-container,
.chart-container {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(77, 171, 247, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 171, 247, 0.8);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}