/* DEUTSCHE FIRMENSUCHE - COMPLETE STYLESHEET 2025 */

/* --- BASIS VARIABLEN --- */
:root {
    --primary: #008080; /* Das klassische Petrol */
    --primary-dark: #005a5a;
    --secondary: #34495e; /* Dunkles Graublau für Text */
    --bg-body: #f4f6f8; /* Sehr helles Grau/Blau, professionell */
    --bg-white: #ffffff;
    --border-color: #e1e4e8;
    --text-main: #2c3e50;
    --text-muted: #6c757d;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; }

/* --- UTILITIES --- */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

/* --- TOP BAR (Compact & Dark) --- */
.top-bar {
    background: #1a1a1a;
    color: #fff;
    padding: 0 5%;
    height: 35px;
    font-size: 0.8rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    overflow: hidden;
}

.top-bar-item {
    display: flex;
    align-items: center;
    height: 100%;
}

.top-bar-item a { color: rgba(255,255,255,0.8); }
.top-bar-item a:hover { color: #fff; }

.top-bar-item .icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    object-fit: contain;
    filter: invert(1); /* Icons weiß machen */
}

/* --- MAIN HEADER --- */
.header-main {
    background: var(--bg-white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-logo img {
    height: 50px;
    display: block;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-right a {
    font-weight: 500;
    color: var(--secondary);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
}

.header-right a:hover {
    background-color: #f0f2f5;
    color: var(--primary);
}

.header-right a[href*="unternehmen-eintragen"] {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.header-right a[href*="unternehmen-eintragen"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* --- CTA BANNER (Green Bar) --- */
.cta-banner {
    background-color: var(--primary);
    padding: 12px 0;
    color: white;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.cta-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    width: 100%;
    padding: 0 20px;
}

.cta-banner p {
    margin: 0;
    font-weight: 500;
    font-size: 1.1rem;
}

.cta-banner .cta-button {
    background: white;
    color: var(--primary);
    padding: 6px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin: 0;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cta-banner .cta-button:hover {
    background: #f0f2f5;
    transform: translateY(-1px);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    background-image: url('/assets/images/main.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.85), rgba(0, 128, 128, 0.75));
}

.hero h1 {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    letter-spacing: -1px;
    line-height: 1.2;
    padding: 0 20px;
}

.hero h1 b {
    color: #fff;
    font-weight: 800;
}

/* --- SEARCH BAR --- */
.search-bar {
    position: relative;
    z-index: 1;
    background: white;
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 900px;
    display: flex;
}

.search-bar form {
    display: flex;
    width: 100%;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar input {
    flex: 1;
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 4px;
    outline: none;
    color: var(--text-main);
    background: #f8f9fa;
    min-width: 200px;
}

.search-bar input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

.search-bar button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background-color: var(--primary-dark);
}

/* --- CONTENT & GRID --- */
.results-container, .container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

h2 {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    margin-top: 10px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.result-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.result-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.result-logo {
    height: 80px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    justify-content: center;
}

.result-logo img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.result-details h3 {
    font-size: 1.25rem;
    margin: 0 0 15px 0;
    color: var(--text-main);
}

.result-details p {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.result-details .icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    opacity: 0.6;
}

.more-info-link {
    margin-top: auto;
    display: inline-block;
    padding: 10px 0;
    color: var(--primary);
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.more-info-link:hover {
    background-color: #f8f9fa;
    color: var(--primary-dark);
}

/* --- INFO BANNER --- */
.info-banner-wrapper {
    grid-column: 1 / -1;
    margin: 40px 0;
}

.info-banner {
    background: white;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow-sm);
    padding: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.info-banner-content { flex: 1; }

.info-banner h2 { border: none; margin-bottom: 15px; font-size: 1.8rem; }
.info-banner h2::after { display: none; }

.info-banner-image img {
    max-width: 250px;
    border-radius: var(--radius);
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 40px 0;
}

.pagination a {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-main);
    border-radius: 4px;
}

.pagination a.active, .pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- SPLIT LAYOUT (Kontakt & Jobs) --- */
.split-container {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
}

.split-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
}

.split-image {
    flex: 1;
    min-width: 300px;
    min-height: 300px;
    background-color: #eee;
    background-size: cover;
    background-position: center;
}

.split-content {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 300px;
}

.split-content h2 {
    margin-top: 0;
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.split-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.split-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.split-content li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 15px;
}

.split-content li::before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.split-content label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.split-content input[type="text"],
.split-content input[type="email"],
.split-content textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fbfbfd;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.split-content input:focus,
.split-content textarea:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
    outline: none;
}

.split-content button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition);
}

.split-content button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.split-content .apply-link {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: var(--primary);
    color: white;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    transition: var(--transition);
}

.split-content .apply-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* --- MODAL --- */
#dynamic-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#dynamic-overlay.active { display: flex; opacity: 1; }

.modal-content {
    background: white;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    position: relative;
    padding: 40px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f0f2f5;
    border: none;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
}

.close-modal:hover { 
    background: var(--primary); 
    color: white; 
}

/* Fix for modal content padding */
.modal-content .detail-container {
    padding: 0;
    box-shadow: none;
    width: 100%;
    border: none;
}

/* --- DETAIL PAGE IN MODAL & STANDALONE --- */
.detail-container {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

/* Wenn Detailseite standalone ist, füge Schatten hinzu */
body > .detail-container, .container > .detail-container {
    box-shadow: var(--shadow-sm);
    padding: 40px;
    margin: 40px auto;
    max-width: 1200px;
}

.detail-logo {
    width: 180px;
    height: 180px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #fff;
}

.detail-box { flex: 1; min-width: 300px; }
.detail-box h2 { margin-top: 0; font-size: 2.2rem; color: var(--text-main); margin-bottom: 10px; }
.detail-box p { margin-bottom: 10px; font-size: 1.05rem; }

/* Kontaktformular im Detail/Modal */
.contact-form {
    background: #f9fafb;
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-top: 20px;
    width: 100%;
}

.modal-content .contact-form {
    margin-top: 20px;
    background: #f8f9fa;
    border: 1px solid #eee;
    box-shadow: none;
}

.contact-form h3 {
    margin-top: 0;
    color: var(--primary);
    border-bottom: 2px solid #e1e4e8;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 15px;
    background: white;
    font-family: inherit;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
    outline: none;
}

.contact-form button {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-form button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.anti-spam {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    display: block;
}

/* --- AUTCOMPLETE DROPDOWN --- */
.autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    color: var(--text-main) !important;
    background-color: white !important;
    font-size: 0.95rem;
}

.autocomplete-item:hover {
    background-color: #f8f9fa !important;
    color: var(--primary) !important;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* --- LISTS (Bundesländer, PLZ, Orte) --- */
.bundeslaender-list, .plz-list, .plz-orte-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.bundeslaender-list li, .plz-list li, .plz-orte-list li {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}

.bundeslaender-list li:hover, .plz-list li:hover, .plz-orte-list li:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.bundeslaender-list a, .plz-list a, .plz-orte-list a {
    display: block;
    padding: 15px;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.bundeslaender-list a:hover, .plz-list a:hover, .plz-orte-list a:hover {
    color: var(--primary-dark);
    background-color: #f8f9fa;
}

/* --- FOOTER --- */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
    margin-top: 60px;
}

.footer a { color: #bdc3c7; margin: 0 10px; }
.footer a:hover { color: white; }

/* --- MOBILE APP & RESPONSIVE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    /* Globale Mobile-Anpassungen */
    body {
        -webkit-tap-highlight-color: transparent;
        padding-bottom: 80px; /* Platz für TabBar */
        overscroll-behavior-y: none; 
    }
    
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
    
    /* Layout Anpassungen */
    .hero {
        height: auto;
        min-height: 300px;
        padding: 40px 15px;
    }
    
    .hero h1 {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 20px;
        padding: 0 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero h1 br {
        display: block;
        margin: 5px 0;
    }
    
    .search-bar {
        flex-direction: column;
        width: 95%;
        padding: 15px;
        gap: 10px;
    }
    
    .search-bar form {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .search-bar input {
        width: 100% !important;
        min-width: unset !important;
        flex: none;
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .search-bar button {
        width: 100%;
        margin-top: 0;
        padding: 14px;
    }
    
    .results-grid { grid-template-columns: 1fr; }
    .result-logo { margin-bottom: 15px; }
    
    .split-box { flex-direction: column; }
    .split-image { min-height: 250px; order: -1; }
    .split-content { padding: 30px; }
    
    .info-banner { flex-direction: column; text-align: center; padding: 20px; }
    .info-banner-image img { max-width: 150px; margin-top: 20px; }
    
    .detail-container { flex-direction: column; padding: 20px; }
    .detail-logo { margin: 0 auto; }
    
    .cta-banner { flex-direction: column; gap: 10px; padding: 20px; }
    
    /* --- APP SPECIFIC UI --- */
    /* Header vereinfachen */
    .header-main {
        position: sticky;
        top: 0;
        padding: 10px 15px;
        height: 60px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 1px 0 rgba(0,0,0,0.05);
        z-index: 1000;
    }
    
    .header-logo img { height: 35px; }
    .header-right { display: none; } /* Desktop Menü ausblenden */
    
    /* Bottom Tab Bar */
    .mobile-tab-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #ffffff;
        border-top: 1px solid rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .tab-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #8e8e93;
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        padding: 5px 0;
        transition: color 0.2s;
    }
    
    .tab-item.active { color: var(--primary); }
    
    .tab-item.highlight .tab-icon {
        background: var(--primary);
        color: white;
        border-radius: 12px;
        padding: 5px;
        margin-top: -15px;
        box-shadow: 0 4px 10px rgba(0, 128, 128, 0.3);
    }
    
    .tab-icon svg { width: 24px; height: 24px; }
    
    /* App Card Style */
    .result-box, .split-box, .info-box, .modal-content {
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
        border: none;
    }
    
    /* Inputs & Buttons Touch-freundlich */
    input, select, textarea, button, .cta-button {
        font-size: 16px !important;
        padding: 14px;
        border-radius: 12px;
    }
    
    /* Modal als Sheet */
    .modal-content {
        width: 100%;
        height: 95vh;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        bottom: 0;
        top: auto;
        margin: 0;
        padding-bottom: 80px;
    }
    
    #dynamic-overlay { align-items: flex-end; }
}
