/* Custom CSS für Immobilienbewertungs-Applikation */

/* Body & Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Form Labels */
label.required::after {
    content: " *";
    color: #dc3545;
}

/* Help Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Tooltips */
.tooltip-icon {
    cursor: help;
    color: #6c757d;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Currency Formatting */
.currency {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Percentage Formatting */
.percent {
    font-family: 'Courier New', monospace;
}

/* Calculation Result Highlighting */
.calculation-result {
    background-color: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 1rem;
    margin: 1rem 0;
}

.calculation-result .result-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.calculation-result .result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0c5460;
}

/* Step Wizard */
.step-wizard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.step-wizard .step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 1rem 0;
}

.step-wizard .step::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #dee2e6;
    z-index: -1;
}

.step-wizard .step:first-child::before {
    left: 50%;
}

.step-wizard .step:last-child::before {
    right: 50%;
}

.step-wizard .step .step-number {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    line-height: 3rem;
    border-radius: 50%;
    background-color: #dee2e6;
    color: #6c757d;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step-wizard .step.active .step-number {
    background-color: #0d6efd;
    color: white;
}

.step-wizard .step.completed .step-number {
    background-color: #198754;
    color: white;
}

.step-wizard .step .step-title {
    font-size: 0.875rem;
    color: #6c757d;
}

.step-wizard .step.active .step-title {
    color: #0d6efd;
    font-weight: bold;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-overlay.show {
    display: flex;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-wizard {
        flex-direction: column;
    }

    .step-wizard .step::before {
        display: none;
    }
}

/* ========== TABLET / IPAD OPTIMIERUNGEN ========== */

/* Touch-freundliche Eingabefelder (min. 44px nach Apple HIG) */
@media (max-width: 1024px) {
    /* Größere Eingabefelder für Touch */
    .form-control,
    .form-select {
        min-height: 48px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
        padding: 0.75rem 1rem;
    }

    /* Größere Buttons für Touch-Targets */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        min-height: 56px;
        padding: 1rem 1.5rem;
    }

    /* Größere Checkboxen und Radio-Buttons */
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
        margin-top: 0.1rem;
    }

    .form-check-label {
        padding-left: 0.5rem;
        font-size: 1rem;
    }

    /* Besserer Abstand zwischen Formularfeldern */
    .mb-3 {
        margin-bottom: 1.25rem !important;
    }

    /* Card-Header besser lesbar */
    .card-header h5 {
        font-size: 1.1rem;
    }

    /* Tabellen horizontal scrollbar */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Navbar-Brand kleiner auf Tablets */
    .navbar-brand img {
        height: 28px;
    }

    .navbar-brand {
        font-size: 1rem;
    }
}

/* Spezifische iPad-Optimierungen (Portrait & Landscape) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Zwei-Spalten-Layout optimieren */
    .col-md-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Mehr Platz für Formulare */
    .card-body {
        padding: 1.5rem;
    }

    /* Größere Überschriften */
    h2 {
        font-size: 1.75rem;
    }

    /* Bessere Lesbarkeit für Tabellen */
    .table td,
    .table th {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    /* Alert-Boxen besser lesbar */
    .alert {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Zinssatz-Herleitung Tabelle */
    .zinssatz-komponente {
        font-size: 16px;
    }
}

/* Mobile Phones (schmaler als iPad) */
@media (max-width: 576px) {
    /* Container volle Breite */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Cards ohne Seitenabstand */
    .card {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }

    /* Stapeln statt nebeneinander */
    .row > .col-md-6,
    .row > .col-md-4,
    .row > .col-md-3 {
        margin-bottom: 1rem;
    }

    /* Größere Verkehrswert-Anzeige */
    .display-3 {
        font-size: 2rem;
    }

    /* Breadcrumb kleiner */
    .breadcrumb {
        font-size: 0.85rem;
    }

    /* Tabellen: Wichtige Spalten hervorheben */
    .table-sm td:first-child,
    .table-sm th:first-child {
        font-weight: 500;
    }
}

/* Touch-spezifische Verbesserungen */
@media (hover: none) and (pointer: coarse) {
    /* Kein Hover-Effekt auf Touch-Geräten */
    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .card:hover {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }

    /* Aktiver Zustand für Touch */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Größere Tap-Bereiche für Links in Tabellen */
    .table a {
        display: inline-block;
        padding: 0.5rem 0;
    }

    /* Dropdown-Menüs größer */
    .dropdown-item {
        padding: 0.75rem 1.5rem;
    }

    /* Navbar-Links größer */
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
}

/* Landscape-Modus auf iPad */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    /* Mehr Platz für Formulare nutzen */
    .container {
        max-width: 960px;
    }
}

/* iPad Pro (größer) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
    }
}

/* Sticky Footer auf allen Geräten */
@media (max-width: 1024px) {
    footer {
        margin-top: auto;
    }

    footer .row {
        text-align: center;
    }

    footer .col-lg-6 {
        margin-bottom: 1.5rem;
    }
}
