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

:root {
    --primary-color: #d4002a;
    --secondary-color: #ffce00;
    --dark-color: #000;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #333 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

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

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

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #f9f9f9;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    background: #e8e8e8;
}

.tab-btn.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* Sections */
.section {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* State Selector */
.state-selector {
    margin-bottom: 30px;
    text-align: center;
}

.state-selector label {
    font-size: 1.2em;
    margin-right: 15px;
    font-weight: 500;
}

#state-select {
    padding: 12px 20px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    min-width: 300px;
    transition: border-color 0.3s ease;
}

#state-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* State Info */
.state-info {
    min-height: 400px;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-message h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #333;
}

.state-card {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.state-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a00020 100%);
    color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.state-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.state-header .capital {
    font-size: 1.3em;
    opacity: 0.95;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.info-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3em;
}

.info-box p {
    font-size: 1.1em;
    color: #333;
    line-height: 1.6;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.05em;
}

.info-box li:last-child {
    border-bottom: none;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.quiz-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
}

.quiz-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1em;
    color: #666;
}

.quiz-stats span {
    font-weight: 500;
}

.quiz-stats span span {
    color: var(--primary-color);
    font-weight: 700;
}

.btn-reset {
    margin-top: 15px;
    padding: 10px 20px;
    font-size: 1em;
    background: #ff6b6b;
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-reset:hover {
    background: #ff5252;
    transform: scale(1.05);
}

.quiz-start {
    text-align: center;
    padding: 60px 20px;
}

.quiz-start h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
}

.quiz-start p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.btn-primary {
    padding: 15px 40px;
    font-size: 1.2em;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover {
    background: #a00020;
    transform: scale(1.05);
}

.question-card {
    background: #f9f9f9;
    padding: 40px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

#question-text {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.answer-options {
    display: grid;
    gap: 15px;
}

.answer-btn {
    padding: 20px;
    font-size: 1.1em;
    background: var(--white);
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-btn:hover {
    border-color: var(--primary-color);
    background: #fff8f8;
    transform: translateX(5px);
}

.answer-btn.correct {
    background: #4caf50;
    color: var(--white);
    border-color: #4caf50;
}

.answer-btn.incorrect {
    background: #f44336;
    color: var(--white);
    border-color: #f44336;
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-result {
    text-align: center;
    padding: 60px 20px;
}

.quiz-result h3 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
}

.final-score {
    font-size: 2em;
    color: var(--primary-color);
    margin: 30px 0;
    font-weight: 700;
}

#result-message {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 30px;
}

/* Compare Section */
.compare-container {
    max-width: 100%;
}

.compare-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.compare-header h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

.compare-header p {
    font-size: 1.1em;
    color: #666;
}

.sort-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sort-controls label {
    font-size: 1.1em;
    font-weight: 500;
}

#sort-select {
    padding: 10px 15px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    min-width: 200px;
}

#sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 1em;
    background: #666;
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #444;
}

.compare-table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 0.95em;
}

.compare-table thead {
    background: linear-gradient(135deg, var(--dark-color) 0%, #333 100%);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.compare-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--dark-color) 0%, #333 100%);
}

.compare-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s ease;
}

.compare-table tbody tr:hover {
    background: #f9f9f9;
}

.compare-table td {
    padding: 12px 10px;
    vertical-align: middle;
}

.state-name {
    font-weight: 600;
    color: var(--primary-color);
}

.state-coat {
    width: 40px;
    height: 50px;
    object-fit: contain;
    display: block;
}

/* Wappen und Karte im Info-Bereich */
.state-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.visual-box {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.visual-box h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.coat-of-arms {
    max-width: 150px;
    height: auto;
    margin: 0 auto;
    display: block;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
}

.coat-of-arms.error {
    display: none;
}

.state-map {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
    background: #f0f0f0;
    padding: 10px;
}

.state-map.error {
    display: none;
}

.fallback-text {
    text-align: center;
    color: #999;
    font-size: 3em;
    padding: 40px;
}

.state-coat.error {
    display: inline-block;
    width: 40px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 4px;
    line-height: 50px;
    text-align: center;
    font-size: 0.8em;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 15px;
        font-size: 1em;
    }

    #state-select {
        min-width: 100%;
    }

    .compare-table {
        font-size: 0.85em;
    }

    .compare-table th,
    .compare-table td {
        padding: 8px 5px;
    }

    .state-visual {
        grid-template-columns: 1fr;
    }

    .sort-controls {
        flex-direction: column;
        align-items: stretch;
    }

    #sort-select,
    .btn-secondary {
        width: 100%;
    }
}

/* Impressum Styles */
.impressum-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.impressum-header {
    background: linear-gradient(135deg, var(--dark-color) 0%, #333 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.impressum-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.impressum-content {
    flex: 1;
    padding: 40px 30px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.impressum-content h2 {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
}

.impressum-content h2:first-child {
    margin-top: 0;
}

.impressum-content p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
    margin-bottom: 20px;
}

.impressum-footer {
    background: #f9f9f9;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #e0e0e0;
    margin-top: auto;
}

.impressum-footer p {
    margin: 0;
    color: #666;
}

.impressum-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.impressum-footer a:hover {
    text-decoration: underline;
}

/* Main Footer */
.main-footer {
    background: #f9f9f9;
    padding: 20px;
    text-align: center;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.main-footer p {
    margin: 0;
    color: #666;
}

.main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
}

.main-footer a:hover {
    text-decoration: underline;
}
