:root {
    /* Durchblick Brand Colors */
    --primary-color: #3f606f;
    --primary-dark: #2d4a56;
    --secondary-color: #5a8a9d;
    --accent-color: #cc5c53;
    --text-color: #5a5a5a;
    --light-bg: #f8fafc;
    --border-color: #dfe5e8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --footer-bg: #444;
    --card-bg: white;
    --input-bg: white;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #5a8a9d;
    --primary-dark: #6aa0b5;
    --secondary-color: #7ab0c5;
    --text-color: #e0e0e0;
    --light-bg: #1a1a2e;
    --border-color: #3a3a5a;
    --card-bg: #252542;
    --input-bg: #2a2a4a;
    --footer-bg: #16162a;
}

[data-theme="dark"] body {
    background-color: var(--light-bg);
    color: var(--text-color);
}

[data-theme="dark"] .calculator-card,
[data-theme="dark"] .result,
[data-theme="dark"] .info-step-card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .law-card,
[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] select {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .warning {
    background-color: rgba(245, 158, 11, 0.15);
}

[data-theme="dark"] .info-alert {
    background-color: rgba(90, 138, 157, 0.15);
}

[data-theme="dark"] .holiday-selection,
[data-theme="dark"] .law-text {
    background: var(--input-bg);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.dark-mode-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: none;
    box-shadow: none;
}

.dark-mode-toggle i {
    font-size: 1rem;
}

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

h1, h2, h3, h4 {
    font-family: 'Economica', Arial, sans-serif;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.calculator-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.required::after {
    content: '*';
    color: var(--accent-color);
    margin-left: 4px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

/* Primary input - larger and more prominent */
#streitwert {
    font-size: 1.25rem;
    padding: 1rem 1.25rem 1rem 3.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background-color: #f0f7fc;
    font-weight: 500;
    text-align: right;
}

#streitwert:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(19, 117, 188, 0.2);
    background-color: white;
}

/* Currency input styling */
.currency-input-wrapper {
    position: relative;
}

.currency-input-wrapper::before {
    content: 'CHF';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-weight: 500;
}

.currency-input-wrapper input {
    padding-left: 3.5rem;
    text-align: right;
}

/* Select styling */
select {
    cursor: pointer;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231375bc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(19, 117, 188, 0.15);
}

/* Checkbox styling */
.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label:hover {
    color: var(--primary-color);
}

/* Form hint text */
.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

/* Info tooltip styling */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    cursor: help;
}

.info-tooltip .info-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.info-tooltip:hover .info-icon {
    background: var(--primary-color);
    transform: scale(1.1);
}

.info-tooltip .tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.info-tooltip .tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--text-color);
}

.info-tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .info-tooltip .tooltip-content {
        width: 220px;
        left: auto;
        right: -10px;
        transform: none;
    }
    .info-tooltip .tooltip-content::after {
        left: auto;
        right: 15px;
        transform: none;
    }
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 117, 188, 0.3);
}

/* Primary submit button */
#kostenForm button[type="submit"] {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warning {
    background-color: #fff5f5;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
}

.warning i {
    color: var(--warning-color);
    margin-right: 0.5rem;
}

/* Result section */
.result {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.result-summary {
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
}

.result-summary h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.result-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.result-row:last-of-type {
    border-bottom: none;
}

.result-row.highlight {
    background: rgba(255,255,255,0.1);
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.25rem 0;
}

.result-row.sub {
    font-size: 0.9rem;
    opacity: 0.9;
    padding-left: 1rem;
}

.result-row.total {
    background: rgba(255,255,255,0.2);
    padding: 1rem;
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.result-divider {
    border-top: 1px dashed rgba(255,255,255,0.3);
    margin: 0.5rem 0;
}

.result-label {
    font-weight: 500;
}

.result-value {
    font-weight: 600;
    text-align: right;
}

.result-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.result-note.warning {
    background: rgba(255,200,0,0.2);
}

.result-note.success {
    background: rgba(16,185,129,0.2);
}

.result-note i {
    margin-top: 0.15rem;
    color: inherit;
}

.result-error {
    background: var(--accent-color);
    color: white;
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-row.free {
    background: rgba(16,185,129,0.2);
    color: white;
    font-weight: bold;
}

/* Result actions */
.result-actions {
    margin-bottom: 1rem;
}

.print-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--secondary-color);
}

/* Steps container */
.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0 3rem 0;
    padding: 0 1rem;
}

.step-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.step-icon {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.step-icon i {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.step-number {
    background: var(--accent-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.step-content h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.step-content p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.step-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.step-content a:hover {
    color: var(--primary-color);
}

@media (max-width: 968px) {
    .steps-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Info cards */
.info-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    padding: 0 1rem;
}

.info-step-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.info-step-card.highlight::before {
    background: linear-gradient(90deg, var(--accent-color), #f56565);
}

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

.info-step-card .step-icon i {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.info-step-card.highlight .step-icon i {
    color: var(--accent-color);
}

.info-step-card h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.info-step-card.highlight h3 {
    color: var(--accent-color);
}

.info-step-card p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.info-step-card ul {
    list-style-type: none;
    padding-left: 0;
}

.info-step-card li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-step-card li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* Header */
.header-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
    gap: 15px;
}

.title-icon {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    margin-right: 12px;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 6px 12px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font: 600 14px/18px 'Economica', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--light-bg);
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.site-footer {
    background: var(--primary-color);
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
    text-align: center;
}

.site-footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.site-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-content p {
    margin: 0.5rem 0;
}

.footer-disclaimer {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 1rem !important;
}

/* Law section */
.law-section {
    margin: 4rem 0;
    padding: 0 1rem;
}

.law-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.law-subtitle {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.law-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.law-header {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 1.5rem;
    color: white;
}

.law-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.law-header h3 a {
    color: white;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.law-header h3 a:hover {
    text-decoration-thickness: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.law-content {
    padding: 1.5rem;
}

.law-content ol {
    list-style-type: none;
    counter-reset: item;
    padding-left: 0;
}

.law-content > ol > li {
    counter-increment: item;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 2rem;
}

.law-content > ol > li:before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: var(--primary-color);
}

/* Fee table */
.fee-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.fee-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
}

.fee-table tr:hover {
    background: #f0f7fc;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.disclaimer-text {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.disclaimer-text p {
    margin-bottom: 1rem;
}

.disclaimer-text ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.disclaimer-text li {
    margin-bottom: 0.5rem;
}

.accept-button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.accept-button:hover {
    background-color: var(--secondary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Print styles */
@media print {
    @page {
        margin: 1.5cm;
        size: A4;
    }

    .steps-container,
    .calculator-card form,
    .info-cards-container,
    .law-section,
    .site-footer,
    .result-actions,
    .language-switcher,
    .header-row,
    h1,
    .modal {
        display: none !important;
    }

    body {
        color: black !important;
        background: white !important;
        font-size: 11pt;
    }

    .container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-header {
        display: flex !important;
        align-items: center;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #1375bc;
    }

    .print-header img {
        max-width: 120px;
        height: auto;
    }

    .print-header h2 {
        color: #1375bc !important;
        font-size: 1.5rem;
        margin: 0;
    }

    .calculator-card {
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .result {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .result-summary {
        background-color: #f8f9fa !important;
        color: black !important;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        padding: 1rem 1.5rem;
        margin-bottom: 1.5rem;
    }

    .result-summary h3 {
        color: #1375bc !important;
    }

    .result-row {
        color: black !important;
        border-bottom-color: #dee2e6 !important;
    }

    .result-row.highlight,
    .result-row.total {
        background: #e9ecef !important;
    }

    .result-note {
        background: #f8f9fa !important;
        color: black !important;
        border: 1px solid #dee2e6;
    }

    .print-footer {
        display: block !important;
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid #dee2e6;
        text-align: center;
        font-size: 8pt;
        color: #6c757d !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .title-icon {
        width: 36px;
        height: 36px;
        margin-right: 8px;
    }

    .info-cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Mobile fix for modal - ensure button is accessible */
    .modal {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .disclaimer-text {
        margin-bottom: 1.5rem;
    }

    .disclaimer-text p {
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

    .disclaimer-text ul {
        margin: 0.75rem 0;
    }

    .accept-button {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}

/* Copy and Share buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
}

.copy-btn, .share-btn {
    margin-right: 0.5rem;
}

.copy-btn.copy-success {
    background-color: var(--success-color);
}

.copy-btn.copy-error {
    background-color: var(--accent-color);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .result-actions {
        flex-direction: column;
    }

    .result-actions button,
    .result-actions a.btn {
        width: 100%;
        justify-content: center;
    }
}

/* Offline Download Section */
.offline-download {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8eef3 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

[data-theme="dark"] .offline-download {
    background: linear-gradient(135deg, #2a2a4a 0%, #252542 100%);
}

.offline-download h3 {
    color: var(--primary-color);
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
}

.offline-download p {
    color: var(--text-color);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.offline-download .ironic {
    font-style: italic;
    opacity: 0.85;
}

.offline-download .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.offline-download .download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.offline-download .file-info {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.75rem;
}
