/* Reset und Basis-Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    margin: 0;
    padding: 0 0 120px 0;
    font-family: arial, helvetica, sans-serif;
    background: linear-gradient(225deg, #959188 0%, #cdb479 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hauptcontainer */
.converter-container {
    max-width: 500px;
    width: 100%;
    background: #FFFFFF;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.15);
    border-width: 2px;
    border-style: solid;
    border-color: #1E3A8A;
}

/* Header */
h1 {
    text-align: center;
    color: #1E3A8A;
    margin: 0 0 2rem 0;
    font-size: 2rem;
    font-weight: 600;
}

/* Sprachauswahl */
.lang-section {
    margin-bottom: 1.5rem;
}

.lang-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lang-row label {
    font-weight: 600;
    color: #4A4A4A;
    margin: 0;
}

.lang-buttons {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    width: 52px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 2px solid #1E3A8A;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
}

.lang-btn:hover {
    background: #F9F5EB;
    border-color: #800020;
    transform: translateY(-1px);
}

.lang-btn:focus {
    outline: 2px solid #D4A017;
    outline-offset: 2px;
}

.lang-btn.active {
    background: #F9F5EB;
    border-color: #800020;
    box-shadow: 0 2px 8px rgba(128, 0, 32, 0.3);
}

.lang-btn img {
    width: 32px;
    height: 24px;
    border-radius: 2px;
    object-fit: contain;
    object-position: center;
}

/* Formular-Layout */
.converter-section {
    margin-bottom: 2rem;
}

.row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.row:last-child {
    margin-bottom: 0;
}

.input-group,
.output-group,
.select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Labels */
label {
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Eingabefelder */
input[type="number"],
select {
    height: 2.75rem;
    width: 100%;
    border: 2px solid #1E3A8A;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: #FFFFFF;
    color: #000000;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #800020;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.3);
}

input[type="number"]:invalid {
    border-color: #800020;
}

/* Output-Feld */
.value-output {
    height: 2.75rem;
    border: 2px solid #1E3A8A;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    background: #F9F5EB;
    display: flex;
    align-items: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #000000;
    min-height: 2.75rem;
}

.value-output:empty::before {
    content: "\00a0";
    opacity: 0;
}

/* Select-Styling */
select {
    background: #FFFFFF;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select:disabled {
    background-color: #F9F5EB;
    color: #4A4A4A;
    cursor: not-allowed;
}

/* Optgroup-Styling */
optgroup {
    font-weight: 600;
    color: #1E3A8A;
    background: #F9F5EB;
}

option {
    padding: 0.25rem 0;
    color: #000000;
    background: #FFFFFF;
}

/* Footer */
footer {
    background: #274087;
    padding: 2rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
}

footer nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

footer a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: rgba(30, 58, 138, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

footer a:hover {
    background: #800020;
    color: #D4A017;
    transform: translateY(-1px);
}

footer a:focus {
    outline: 2px solid #D4A017;
    outline-offset: 2px;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 58, 138, 0.95);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(30, 58, 138, 0.3);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-banner-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-banner-text a {
    color: #D4A017;
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: #D4A017;
    color: #000000;
}

.cookie-btn-accept:hover {
    background: #1E3A8A;
    color: #FFFFFF;
}

.cookie-btn-decline {
    background: #800020;
    color: #FFFFFF;
}

.cookie-btn-decline:hover {
    background: #4A4A4A;
}

.cookie-btn-settings {
    background: #F9F5EB;
    color: #000000;
    border: 1px solid #1E3A8A;
}

.cookie-btn-settings:hover {
    background: #1E3A8A;
    color: #FFFFFF;
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.75);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cookie-modal h3 {
    color: #1E3A8A;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #1E3A8A;
    border-radius: 8px;
    background: #F9F5EB;
}

.cookie-category h4 {
    color: #1E3A8A;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #4A4A4A;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.cookie-switch.active {
    background: #1E3A8A;
}

.cookie-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.3);
}

.cookie-switch.active::after {
    transform: translateX(26px);
}

/* Call-to-Action Button (Gold) für wichtige Aktionen */
.cta-button, .btn-convert {
    background: #D4A017;
    color: #000000;
    border: 2px solid #D4A017;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.cta-button:hover, .btn-convert:hover {
    background: #1E3A8A;
    color: #FFFFFF;
    border-color: #1E3A8A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 160, 23, 0.3);
}

.cta-button:focus, .btn-convert:focus {
    outline: 3px solid #800020;
    outline-offset: 2px;
}

.cta-button:active, .btn-convert:active {
    transform: translateY(0);
}

.cookie-switch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .converter-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .lang-buttons {
        flex-wrap: wrap;
    }
    
    footer nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .cookie-modal-buttons {
        flex-direction: column;
    }
    
    .cookie-category h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .converter-container {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .lang-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Content-Container für Impressum/Datenschutz */
.content-container {
    background: #FFFFFF;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.15);
    max-width: 800px;
    width: 100%;
    margin: 2rem auto;
    line-height: 1.6;
}

.content-container h2 {
    color: #1E3A8A;
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

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

.content-container h3 {
    color: #1E3A8A;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
}

.content-container p {
    margin-bottom: 1rem;
    color: #000000;
}

.content-container ul {
    color: #000000;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.content-container li {
    margin-bottom: 0.5rem;
}

.content-container a {
    color: #1E3A8A;
    text-decoration: none;
}

.content-container a:hover {
    color: #800020;
    text-decoration: underline;
}

.content-container img {
    margin: 1rem 0;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .content-container {
        padding: 1.5rem;
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: #FFFFFF;
    }
    
    .lang-section,
    footer,
    .cookie-banner,
    .cookie-modal {
        display: none;
    }
    
    .converter-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}