/* Modern Vikings - Responsive CSS with Dark Mode */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --background-color: #ecf0f1;
    --border-color: #bdc3c7;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --tab-bg: #ffffff;
    --tab-hover-bg: #e8f4fd;
    --tab-active-bg: #3498db;
    --section-bg: rgba(255, 255, 255, 0.25);
    --section-border: rgba(255, 255, 255, 0.4);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #e0e0e0;
    --secondary-color: #b0b0b0;
    --accent-color: #ff6b6b;
    --text-color: #e0e0e0;
    --background-color: #1a1a1a;
    --border-color: #404040;
    --light-gray: #2d2d2d;
    --dark-gray: #808080;
    --tab-bg: #2d2d2d;
    --tab-hover-bg: #333333;
    --tab-active-bg: #0056b3;
    --section-bg: rgba(45, 45, 45, 0.25);
    --section-border: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 0;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../viki.png');
    background-repeat: repeat;
    background-size: 180px 180px;
    background-position: 0 0;
    opacity: 0.07;
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* ASCII Art Styling */
.ascii-header, .ascii-footer {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    white-space: pre;
    overflow-x: auto;
    background-color: var(--section-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 1rem;
    border: 1px solid var(--section-border);
    border-radius: 4px;
    margin: 1rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.ascii-header {
    text-align: center;
    font-weight: bold;
}

.ascii-footer {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* Header */
header {
    background-color: var(--section-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem;
    border-bottom: 1px solid var(--section-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Navigation */
nav {
    margin: 1rem 0;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.nav-list li {
    margin: 0;
    flex-shrink: 0;
}

.nav-list a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px 6px 0 0;
    border: 2px solid var(--border-color);
    border-bottom: none;
    background-color: var(--tab-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: block;
    position: relative;
    margin-bottom: -2px;
    font-weight: 500;
}

.nav-list a:hover,
.nav-list a:focus {
    background-color: var(--tab-hover-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
    z-index: 10;
}

.nav-list a:active,
.nav-list a.active {
    background-color: var(--tab-active-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border-color: var(--tab-active-bg);
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 10;
}

/* Search & Controls */
.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.theme-toggle {
    background: var(--tab-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle:hover {
    background-color: var(--tab-hover-bg);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* Search */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

input[data-q] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
    transition: border-color 0.3s ease;
    background-color: var(--tab-bg);
    color: var(--text-color);
}

input[data-q]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    border-top: 2px solid var(--border-color);
    background-color: var(--section-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    min-height: 60vh;
    border-left: 1px solid var(--section-border);
    border-right: 1px solid var(--section-border);
    border-bottom: 1px solid var(--section-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Grid Layout - Remove grid for single page view */
@media (min-width: 720px) {
    /* No grid layout needed for single page tabs */
}

/* Sections - Tab content styling */
section {
    background-color: transparent;
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    border-bottom: none;
    display: none; /* Hide all sections by default */
}

section.active {
    display: block; /* Show only active section */
}

section:target {
    border-left: 4px solid var(--accent-color);
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0% { background-color: rgba(231, 76, 60, 0.1); }
    100% { background-color: var(--section-bg); }
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--tab-bg);
    box-shadow: 0 1px 3px var(--shadow-color);
    border-radius: 4px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

caption {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

tbody tr:hover {
    background-color: var(--light-gray);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Special Elements */
.dmr-hinweis {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    color: #856404;
    font-weight: 500;
}

/* Vereinsdaten und Impressum Styling */
.vereinsdaten, .impressum {
    background-color: var(--section-bg);
    border: 1px solid var(--section-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.anschrift {
    background-color: var(--light-gray);
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 4px 4px 0;
    font-family: 'Courier New', Consolas, monospace;
    transition: background-color 0.3s ease;
}

.impressum h4 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

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

.impressum p {
    text-align: justify;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.vereinsdaten p {
    margin-bottom: 0.75rem;
}

.vereinsdaten strong {
    display: inline-block;
    min-width: 140px;
    color: var(--primary-color);
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--primary-color);
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--section-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

footer button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

footer button:hover,
footer button:focus {
    background-color: #c0392b;
    outline: 2px solid white;
    outline-offset: 2px;
    transform: translateY(-2px);
}

/* Hidden sections (for search filter and tab switching) */
section.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 719px) {
    .nav-list {
        justify-content: flex-start;
        gap: 0.25rem;
    }
    
    .nav-list a {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    .ascii-header, .ascii-footer {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem 0.5rem;
    }
    
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .ascii-header, .ascii-footer {
        font-size: 0.6rem;
        overflow-x: scroll;
    }
    
    input[data-q] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Print styles */
@media print {
    header {
        position: static;
        box-shadow: none;
    }
    
    .search-container,
    footer button {
        display: none;
    }
    
    section {
        box-shadow: none;
        border: 1px solid var(--border-color);
        page-break-inside: avoid;
    }
    
    a {
        color: var(--text-color);
    }
}

/* Focus management for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000;
        --secondary-color: #333;
        --accent-color: #d00;
        --text-color: #000;
        --background-color: #fff;
        --border-color: #000;
        --light-gray: #f0f0f0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
