/* Weidemanagement App – Custom Styles */

/* Ampel-Farben (traffic light) */
.ampel-gruen  { color: #198754; }
.ampel-gelb   { color: #ffc107; }
.ampel-rot    { color: #dc3545; }

/* Dashboard cards */
.stat-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

/* Map container */
#map, #feldstuckMap {
    min-height: 400px;
    border-radius: 0.375rem;
    z-index: 1;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
}

.leaflet-popup-content {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.05);
}

/* Progress bars */
.progress {
    background-color: #e9ecef;
}

/* Form improvements */
.form-control:focus, .form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}

/* Badge pill */
.badge-pill {
    border-radius: 50rem;
    padding: 0.35em 0.65em;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
}

/* Tier-Karte */
.tier-card {
    border-left: 4px solid #198754;
    transition: box-shadow 0.15s;
}

.tier-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1) !important;
}

/* Feldstück polygon hover */
.feldstuck-row {
    cursor: pointer;
}

/* Import dropzone */
.dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.15s, background-color 0.15s;
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #198754;
    background-color: rgba(25, 135, 84, 0.05);
}

/* Print styles */
@media print {
    .navbar, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #map, #feldstuckMap {
        min-height: 250px;
    }
}

/* ── Touch- & Lesbarkeits-Optimierung (Handy im Feld) ─────────────── */
/* Verhindert iOS-Auto-Zoom: Eingabefelder mind. 16px auf dem Handy */
@media (max-width: 768px) {
    .form-control, .form-select {
        font-size: 16px;
    }
    /* Größere Tipp-Flächen im aufgeklappten Menü */
    .navbar .dropdown-item {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }
}

/* Daumen-taugliche Schaltflächen auf Touch-Geräten (min. 44px Höhe) */
@media (pointer: coarse) {
    .btn:not(.btn-sm):not(.btn-close) {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .navbar-toggler {
        padding: 0.5rem 0.75rem;
    }
}

/* Scroll to top button */
#scrollTopBtn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    z-index: 999;
}

/* Loading spinner overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Timeline for Weidetagebuch */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.35rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #198754;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #198754;
}

/* Navbar brand */
.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

[x-cloak] { display: none !important; }

/* Farb-Picker (Maßnahmentypen) */
.farb-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;   /* verhindert Schrumpfen im Flex-Container */
    min-height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    outline: none;
    display: inline-block;
    flex-shrink: 0;
    transition: transform 0.1s, border-color 0.1s;
    position: relative;
}
.farb-btn:hover { transform: scale(1.15); }
.farb-btn.ausgewaehlt {
    border-color: #212529;
    box-shadow: 0 0 0 2px #fff inset;
}
.farb-btn.ausgewaehlt::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
