/* Custom styles for ORTHEGROH Dealer Finder */

/* ORTHEGROH Brand colors - High Contrast for Accessibility */
:root {
    --orthegroh-primary: #003d80;
    --orthegroh-secondary: #002960;
    --orthegroh-accent: #0052cc;
    --orthegroh-light: #f0f7ff;
    --orthegroh-gray: #6c757d;
    --orthegroh-success: #006633;
    --orthegroh-warning: #cc6600;
    --orthegroh-error: #cc0000;
    --orthegroh-gradient: linear-gradient(135deg, #003d80 0%, #002960 100%);
    --text-high-contrast: #212529;
    --bg-white: #ffffff;
    --border-light: #dee2e6;
}

/* Body and base styles for accessibility */
body {
    background-color: var(--bg-white);
    color: var(--text-high-contrast);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* High contrast button styling */
.btn-primary {
    background-color: var(--orthegroh-primary);
    border: 2px solid var(--orthegroh-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--orthegroh-secondary);
    border-color: var(--orthegroh-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 61, 128, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.text-primary {
    color: var(--orthegroh-primary) !important;
}

.bg-primary {
    background-color: var(--orthegroh-primary) !important;
}

/* ORTHEGROH Maps Button Styling */
.btn-secondary {
    background-color: var(--orthegroh-gray);
    border: 2px solid var(--orthegroh-gray);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: #5a6268;
    border-color: #5a6268;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

.badge.bg-primary {
    background: var(--orthegroh-gradient) !important;
}

/* Modern gradient navbar */
.navbar-dark {
    background: var(--orthegroh-gradient) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* iPad-optimierte Messe-Gestaltung */
.hero-section-tablet {
    background: linear-gradient(135deg, var(--orthegroh-light) 0%, #ffffff 100%);
    padding: 3rem 0 4rem 0;
    min-height: 40vh;
    display: flex;
    align-items: center;
}

/* Tablet-optimierte Touch-Targets */
@media (min-width: 768px) {
    .btn-lg {
        padding: 1.2rem 2.5rem;
        font-size: 1.3rem;
        min-height: 60px;
    }
    
    .form-control-lg, .form-select-lg {
        padding: 1rem 1.5rem;
        font-size: 1.2rem;
        min-height: 60px;
    }
    
    .card {
        font-size: 1.1rem;
    }
    
    .list-group-item {
        padding: 1.5rem;
    }
    
    h6.fw-bold {
        font-size: 1.3rem;
    }
    
    .btn-sm {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Modern card styling with ORTHEGROH design language */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

/* ORTHEGROH Logo positioning in dealer results */
.list-group-item.position-relative {
    padding-top: 2rem; /* Make room for the logo */
}

.orthegroh-dealer-logo {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    height: 25px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.list-group-item:hover .orthegroh-dealer-logo {
    opacity: 1;
}

/* Angepasste Logo-Position */
.list-group-item.position-relative {
    padding-top: 2rem;
}

/* iPad Landscape optimierte Darstellung */
@media (min-width: 1024px) and (max-width: 1366px) {
    .hero-section-tablet {
        padding: 2rem 0 3rem 0;
        min-height: 25vh;
    }
    
    .display-3 {
        font-size: 3.2rem;
        line-height: 1.1;
    }
    
    .lead.fs-4 {
        font-size: 1.4rem !important;
        max-width: 80%;
        margin: 0 auto;
    }
    
    .container-fluid {
        max-width: 1280px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .card-body {
        padding: 2.5rem 3rem;
    }
    
    .list-group-item {
        padding: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .orthegroh-dealer-logo {
        height: 30px;
        top: 0.75rem;
        right: 1.25rem;
    }
    
    /* Bessere horizontale Nutzung des Platzes */
    .row.g-3 {
        gap: 2rem !important;
    }
    
    .col-md-6 {
        flex: 0 0 auto;
        width: calc(50% - 1rem);
    }
    
    /* Größere Touch-Targets für iPad */
    .btn-lg {
        padding: 1.5rem 3rem;
        font-size: 1.4rem;
        min-height: 70px;
        border-radius: 0.875rem;
    }
    
    .form-control-lg, .form-select-lg {
        padding: 1.25rem 1.75rem;
        font-size: 1.3rem;
        min-height: 70px;
        border-radius: 0.875rem;
    }
    
    .btn-sm {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 56px;
        border-radius: 0.75rem;
    }
    
    /* Bessere Darstellung der Händler-Karten */
    .list-group-item .row .col-md-8 {
        flex: 0 0 auto;
        width: 60%;
    }
    
    .list-group-item .row .col-md-4 {
        flex: 0 0 auto;
        width: 40%;
    }
    
    h6.fw-bold {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .badge.rounded-pill {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }
    
    /* Optimierte Button-Gruppen */
    .btn-group-vertical {
        gap: 0.75rem;
    }
    
    /* Verbesserte Formular-Labels */
    .form-label {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-text {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
}

/* Verbessertes Touch-Feedback */
.btn:active, .list-group-item:active {
    transform: translateY(1px);
}

.form-control:focus, .form-select:focus {
    border-color: var(--orthegroh-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 61, 128, 0.25);
}

/* iPad Portrait optimierte Darstellung */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-section-tablet {
        padding: 2.5rem 0 3.5rem 0;
        min-height: 30vh;
    }
    
    .display-3 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .lead.fs-4 {
        font-size: 1.3rem !important;
    }
}

/* Verbessertes Button-Design für Messe-Nutzung */
.btn-primary, .btn-success {
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: none;
}

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

.btn-success:hover, .btn-success:focus {
    background-color: #004d26;
    border-color: #004d26;
}

/* Bessere Sichtbarkeit für Messe-Umgebung */
.card-header {
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.badge.bg-info {
    background-color: var(--orthegroh-accent) !important;
    color: white !important;
}

/* Touch-freundliche Darstellung für alle Elemente */
.list-group-item {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
    border-radius: 0.75rem;
}

.list-group-item:hover {
    background-color: rgba(0, 61, 128, 0.02);
    border-color: var(--orthegroh-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Grundlegende Druckoptimierung */
#printArea {
    display: none;
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: -1;
}

/* Sicherstellen, dass Druckstile korrekt angewendet werden */
@media print {
    body {
        margin: 0 !important;
        padding: 0 !important;
    }
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 0 !important;
    border-bottom: none;
    background: var(--orthegroh-gradient);
    color: white;
    padding: 1.5rem;
    position: relative;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--orthegroh-accent), var(--orthegroh-primary));
}

.card-body {
    padding: 2rem;
}

/* Modern form styling */
.form-control,
.form-select {
    border-radius: 0.75rem;
    border: 2px solid #e9ecef;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--orthegroh-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.15);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--orthegroh-dark);
    margin-bottom: 0.75rem;
}

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

/* Accessible dealer list styling */
.list-group-item {
    border: 2px solid var(--border-light);
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    padding: 1.5rem;
    background: white;
    transition: all 0.2s ease;
    border-left: 4px solid var(--orthegroh-primary);
}

.list-group-item:hover, .list-group-item:focus-within {
    background-color: var(--orthegroh-light);
    border-color: var(--orthegroh-primary);
    box-shadow: 0 0 0 3px rgba(0, 61, 128, 0.1);
}

.list-group-item .text-primary {
    color: var(--orthegroh-primary) !important;
    font-weight: 600;
}

.list-group-item .text-muted {
    color: var(--text-high-contrast) !important;
    opacity: 0.7;
}

/* High contrast accessible button styling */
.btn-outline-primary {
    border: 2px solid var(--orthegroh-primary);
    color: var(--orthegroh-primary);
    background-color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--orthegroh-primary);
    border-color: var(--orthegroh-primary);
    color: white;
    box-shadow: 0 0 0 3px rgba(0, 61, 128, 0.25);
}

.btn-outline-secondary {
    border: 2px solid var(--text-high-contrast);
    color: var(--text-high-contrast);
    background-color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--text-high-contrast);
    border-color: var(--text-high-contrast);
    color: white;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.25);
}

.btn-group-vertical .btn {
    margin-bottom: 0.5rem;
    border-radius: 0.5rem !important;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    .display-5 {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
        border-radius: 0 0 1rem 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .list-group-item {
        padding: 1rem;
    }
    
    .btn-group-vertical {
        width: 100%;
        margin-top: 0.75rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
}

/* Loading animation for search button */
.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Icon spacing improvements */
.fas {
    width: 1.2em;
    text-align: center;
}

/* Enhanced shadow effects */
.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Modern navbar styling */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 1rem 0;
}

/* Footer link hover effects */
.hover-opacity-100 {
    transition: opacity 0.3s ease;
}

.hover-opacity-100:hover {
    opacity: 1 !important;
}

/* Accessible hero section */
.hero-section {
    background-color: var(--orthegroh-light);
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--orthegroh-primary);
}

.hero-section h1 {
    color: var(--orthegroh-primary);
    font-weight: 700;
}

.hero-section .lead {
    color: var(--text-high-contrast);
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Alert styling improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Badge styling */
.badge {
    font-weight: 500;
    font-size: 0.75em;
}

/* Info cards at bottom */
.card.border-0.bg-transparent .card-body {
    padding: 1.5rem 1rem;
}

.card.border-0.bg-transparent .fas {
    opacity: 0.8;
}

/* Smooth transitions */
.btn, .card, .list-group-item {
    transition: all 0.2s ease-in-out;
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* Numerische Tastatur Styling */
.numeric-keypad {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.keypad-header {
    color: var(--orthegroh-primary);
    margin-bottom: 1rem;
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto;
}

.keypad-grid-centered {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.keypad-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 0.75rem;
    color: var(--orthegroh-primary);
    font-size: 1.4rem;
    font-weight: 600;
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.keypad-btn:hover {
    background: linear-gradient(135deg, var(--orthegroh-primary) 0%, var(--orthegroh-secondary) 100%);
    border-color: var(--orthegroh-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 61, 128, 0.3);
}

.keypad-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 61, 128, 0.4);
}

.keypad-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    border-color: #28a745 !important;
    color: white !important;
}

.keypad-submit:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%) !important;
    border-color: #218838 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.keypad-backspace {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}

.keypad-backspace:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%) !important;
    border-color: #e0a800 !important;
    color: #212529 !important;
}

/* iPad-optimierte Tastatur-Größen */
@media (min-width: 1024px) and (max-width: 1366px) {
    .numeric-keypad {
        padding: 2rem;
    }
    
    .keypad-grid {
        gap: 1rem;
        max-width: 320px;
    }
    
    .keypad-grid-centered {
        gap: 1.25rem;
        max-width: 480px;
    }
    
    .keypad-btn {
        height: 70px;
        font-size: 1.6rem;
        border-radius: 1rem;
    }
    
    .keypad-header small {
        font-size: 1.1rem;
    }
    
    /* iPad-optimierte zentrierte Suchmaske */
    .numeric-keypad {
        padding: 1.5rem;
    }
    
    .keypad-grid-centered {
        gap: 1rem;
        max-width: 400px;
    }
    
    /* Sehr große Eingabefelder für iPad */
    #postal_code {
        height: 80px !important;
        font-size: 2rem !important;
        padding: 1.5rem !important;
        border-width: 3px !important;
    }
    
    /* Radius-Feld mit kleinerer Schrift für Dropdown */
    #radius {
        height: 80px !important;
        font-size: 1.4rem !important;
        padding: 1.5rem !important;
        border-width: 3px !important;
    }
    
    /* Dropdown-Optionen richtige Größe */
    #radius option {
        font-size: 1.4rem !important;
        padding: 0.8rem !important;
        line-height: 1.6rem !important;
    }
    
    /* Dropdown-Pfeil und Schrift anpassen */
    #radius {
        background-size: 16px 12px !important;
        background-position: right 1rem center !important;
    }
    
    .form-label {
        font-size: 1.4rem !important;
        margin-bottom: 1rem !important;
    }
    
    .form-text {
        font-size: 1.1rem !important;
        margin-top: 0.75rem !important;
    }
    
    /* Größere Überschrift für iPad */
    .card-header .card-title {
        font-size: 2.2rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
    }
}

/* Responsive Anpassungen für kleinere Bildschirme */
@media (max-width: 768px) {
    .numeric-keypad {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .keypad-grid {
        gap: 0.5rem;
        max-width: 240px;
    }
    
    .keypad-btn {
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.loading-container {
    text-align: center;
    max-width: 500px;
    padding: 3rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--orthegroh-primary);
}

.loading-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.loading-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: logoFloat 2s ease-in-out infinite;
}

.loading-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 3px solid var(--orthegroh-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

.loading-title {
    color: var(--orthegroh-primary);
    font-weight: 600;
    font-size: 1.4rem;
}

.loading-progress {
    background: #e9ecef;
    border-radius: 25px;
    height: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.loading-bar {
    background: linear-gradient(90deg, var(--orthegroh-primary), var(--orthegroh-accent));
    height: 100%;
    border-radius: 25px;
    width: 0%;
    animation: progressBar 6s ease-in-out forwards;
    animation-fill-mode: forwards;
}

.loading-steps {
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.loading-step.active {
    color: var(--orthegroh-primary);
    opacity: 1;
    font-weight: 600;
}

.loading-step.active i {
    animation: stepIcon 1s ease-in-out infinite;
}

.loading-step.completed {
    color: var(--orthegroh-success);
    opacity: 0.8;
}

.loading-step.completed i::before {
    content: "\f00c"; /* Check icon */
}

/* Loading Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
}

@keyframes progressBar {
    0% { width: 0%; }
    20% { width: 25%; }
    40% { width: 50%; }
    60% { width: 70%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

@keyframes stepIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* iPad-optimierte Loading-Größen */
@media (min-width: 1024px) and (max-width: 1366px) {
    .loading-container {
        padding: 4rem;
        max-width: 600px;
    }
    
    .loading-logo {
        height: 80px;
    }
    
    .loading-title {
        font-size: 1.6rem;
    }
    
    .loading-step {
        font-size: 1.1rem;
        padding: 1rem 0;
    }
    
    .loading-pulse {
        width: 120px;
        height: 120px;
    }
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .loading-container {
        padding: 2rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .loading-logo {
        height: 50px;
    }
    
    .loading-title {
        font-size: 1.2rem;
    }
    
    .loading-step {
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    footer,
    .btn,
    .loading-overlay {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}
