/* Minimales CSS für die Karten-Anwendung */

/* Fira Sans von Google Fonts wird verwendet */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

header {
    background-color: #D4312A;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

header a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

header a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 240px;
    padding: 0;
    flex: 1;
    overflow: hidden;
    width: 100%;
    min-height: 0;
}

.navigation,
.map-container,
.legend {
    background-color: #F2F2F2;
    border: 1px solid #e0e0e0;
}

.navigation,
.legend {
    background-color: #F2F2F2;
}

.map-container {
    background-color: white;
}

.navigation {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.navigation:empty::before {
    content: "Lade Navigation...";
    padding: 0.75rem;
    color: #666;
    text-align: center;
    font-size: 0.8125rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.375rem 0.5rem;
    cursor: pointer;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #f5f5f5;
}

.nav-item.active {
    font-weight: 500;
}

.nav-item input[type="radio"],
.nav-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.nav-item-icon svg path {
    fill: #333;
}

.nav-item.active .nav-item-icon svg path {
    fill: #D4312A;
}

.nav-item .nav-item-icon-check-off {
    display: block;
}

.nav-item .nav-item-icon-check-on {
    display: none;
}

.nav-item.active .nav-item-icon-check-off {
    display: none;
}

.nav-item.active .nav-item-icon-check-on {
    display: block;
}

.nav-item label {
    flex: 1;
    margin: 0;
    cursor: pointer;
    font-size: 0.8125rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.map-container {
    padding: 0.75rem;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

#svg-container {
    width: 600px;
    height: 882px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#svg-container svg {
    width: 100%;
    height: 100%;
    display: block;
}

#svg-container path {
    transition: fill-opacity 0.3s ease, stroke 0.3s ease, opacity 0.3s ease;
}

#svg-container path[id^="outline-"] {
    cursor: pointer;
}

#svg-container path[id^="outline-"]:hover {
    opacity: 0.7;
    stroke-width: 0.7;
}

/* Tooltip für Bundesländer */
#state-tooltip {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 10000;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.state-layer {
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.item-layer {
    transition: background-color 0.3s ease, opacity 0.3s ease, background-image 0.3s ease;
}

.legend {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #e0e0e0;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    background-repeat: repeat;
    background-size: auto;
}

.legend-label {
    font-size: 0.8125rem;
    line-height: 1.4;
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: #D4312A;
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background-color: #F2F2F2;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    background-color: white;
}

/* Buttons */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    font-family: inherit;
    line-height: 1;
}

button.secondary {
    background-color: #757575;
    color: white;
}

button.secondary:hover {
    background-color: #616161;
}

button:not(.secondary):not(.modal-close) {
    background-color: #D4312A;
    color: white;
}

button:not(.secondary):not(.modal-close):hover {
    background-color: #B02822;
}

button.contrast {
    background-color: #D4312A;
    color: white;
}

button.contrast:hover {
    background-color: #B02822;
}

/* Editor */
.category-section {
    background: white;
}

.category-section.open {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.category-section.closed {
    padding: 0;
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.category-section.open .category-header {
    border-bottom: 1px solid #e0e0e0;
}

.category-section.closed .category-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.category-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    font-size: 0.9375rem;
    font-family: inherit;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #D4312A;
}

.form-group input[type="color"] {
    height: 48px;
    cursor: pointer;
    padding: 0.25rem;
}

.items-section {
    margin-top: 1.5rem;
}

.items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.items-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.item-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #D4312A;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.item-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.item-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.states-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1.25rem;
    background: #F2F2F2;
    border: 1px solid #e0e0e0;
}

.state-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.state-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.state-checkbox label {
    cursor: pointer;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 1.5rem;
    display: none;
    z-index: 10000;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #333;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.btn-icon:hover:not(:disabled) {
    color: #D4312A;
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.accordion-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.75rem;
    color: #666;
}

.btn-icon-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.btn-icon-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.btn-icon-icon path {
    fill: currentColor;
    transition: fill 0.2s;
}

.btn-icon:hover:not(:disabled) .btn-icon-icon path {
    fill: #D4312A;
}

/* Startbildschirm */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-screen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.start-screen .map-container {
    flex: 1;
    overflow: auto;
}

.start-screen-footer {
    padding: 2rem;
    text-align: center;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-display {
    font-size: 1rem;
    font-weight: 500;
    color: white;
}

/* Timeline */
.timeline-container {
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 2rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: fit-content;
    justify-content: center;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
    position: relative;
    min-width: 100px;
}

.timeline-item:hover {
    background-color: #f5f5f5;
}

.timeline-item.active {
    background-color: #D4312A;
    color: white;
}

.timeline-item.active:hover {
    background-color: #B02822;
}

.timeline-item-date {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

.timeline-item.active .timeline-item-date {
    color: white;
}

.timeline-connector {
    width: 2px;
    height: 20px;
    background-color: #e0e0e0;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.timeline-item.active + .timeline-connector {
    background-color: #D4312A;
}

/* Bundesland-Details Modal */
.state-details-content {
    max-width: 800px;
}

.state-details-section {
    margin-bottom: 2rem;
}

.state-details-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.state-details-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.scenarios-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.scenario-card {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    background-color: white;
}

.scenario-card h4 {
    margin-top: 0;
}

#state-current-poll,
#state-bundesrat-impact {
    padding: 1rem;
    background-color: white;
    border: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .navigation {
        max-height: 200px;
    }

    .legend {
        max-height: 150px;
    }

    .category-form,
    .item-form {
        grid-template-columns: 1fr;
    }

    .scenarios-container {
        grid-template-columns: 1fr;
    }
}
