/* ==========================================================
   AgroAktiv Modern UI Overlay
   Modernisiert das BS3-Layout ohne strukturelle Änderungen
   ========================================================== */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Basis --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: #f4f6f9;
    color: #2d3748;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navbar --- */
.navbar-inverse {
    background: #1e293b !important;
    border: none !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    min-height: 50px !important;
}

.navbar-inverse .navbar-nav > li > a {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: 0.2px;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 6px;
    margin: 5px 2px;
    padding: 10px 14px !important;
    line-height: 20px;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    border-radius: 6px;
}

.navbar-form .form-control {
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}

.navbar-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.navbar-form .form-control:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: none !important;
}

/* --- Buttons --- */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 7px 16px;
}

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

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

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: #fff !important;
}

.btn-success:hover {
    background: linear-gradient(135deg, #2dbc4e 0%, #28a745 100%) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%) !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a9de0 0%, #4a90d9 100%) !important;
}

.btn-default {
    background: #fff !important;
    color: #4a5568 !important;
    border: 1px solid #e2e8f0 !important;
}

.btn-default:hover {
    background: #f7fafc !important;
    border-color: #cbd5e0 !important;
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%) !important;
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%) !important;
    color: #fff !important;
}

/* --- Cards / Panels / Alerts --- */
.panel {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
}

.panel-heading {
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.alert {
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    font-size: 13.5px;
}

.alert-success {
    background-color: #f0fff4 !important;
    color: #276749 !important;
    border-left: 4px solid #48bb78 !important;
}

.alert-warning {
    background-color: #fffff0 !important;
    color: #975a16 !important;
    border-left: 4px solid #ecc94b !important;
}

.alert-danger {
    background-color: #fff5f5 !important;
    color: #9b2c2c !important;
    border-left: 4px solid #fc8181 !important;
}

.alert-info {
    background-color: #ebf8ff !important;
    color: #2b6cb0 !important;
    border-left: 4px solid #63b3ed !important;
}

/* --- Tabellen --- */
.table {
    border-collapse: separate !important;
    border-spacing: 0;
}

.table > thead > tr > th {
    background-color: #f7fafc !important;
    color: #4a5568 !important;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 10px 12px !important;
}

.table > tbody > tr > td {
    border-color: #edf2f7 !important;
    padding: 9px 12px !important;
    vertical-align: middle !important;
    font-size: 13.5px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fafbfc !important;
}

.table > tbody > tr:hover > td {
    background-color: #edf2f7 !important;
}

.table-bordered {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden;
}

/* --- Formulare --- */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 12px !important;
    font-size: 13.5px;
    color: #2d3748 !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff !important;
}

.form-control:focus {
    border-color: #4a90d9 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15) !important;
    outline: none;
}

label, .control-label {
    font-weight: 500 !important;
    font-size: 13px;
    color: #4a5568;
}

/* --- Pagination --- */
.pagination > li > a,
.pagination > li > span {
    border-radius: 8px !important;
    margin: 0 2px;
    border: 1px solid #e2e8f0 !important;
    color: #4a5568;
    font-size: 13px;
    padding: 6px 12px;
    transition: all 0.2s;
}

.pagination > li > a:hover {
    background-color: #edf2f7 !important;
    border-color: #cbd5e0 !important;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    border-color: #28a745 !important;
    color: #fff !important;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    background: transparent !important;
    padding: 8px 0 !important;
    font-size: 13px;
    border-radius: 0 !important;
}

/* --- Wells --- */
.well {
    border: none !important;
    border-radius: 10px !important;
    background-color: #f7fafc !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* --- Dropdowns --- */
.dropdown-menu {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    padding: 6px !important;
    margin-top: 4px !important;
}

.dropdown-menu > li > a {
    border-radius: 6px;
    padding: 8px 14px !important;
    font-size: 13.5px;
    color: #4a5568 !important;
    transition: background-color 0.15s;
}

.dropdown-menu > li > a:hover {
    background-color: #f0fff4 !important;
    color: #276749 !important;
}

/* --- Modals --- */
.modal-content {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
}

.modal-header {
    border-bottom: 1px solid #edf2f7 !important;
    border-radius: 14px 14px 0 0 !important;
    padding: 16px 20px !important;
}

.modal-footer {
    border-top: 1px solid #edf2f7 !important;
    border-radius: 0 0 14px 14px !important;
    padding: 12px 20px !important;
}

/* --- Pills / Tabs --- */
.nav-pills > li > a {
    border-radius: 8px !important;
    font-weight: 500;
    font-size: 13.5px;
    color: #4a5568;
    transition: all 0.2s;
    padding: 8px 16px;
}

.nav-pills > li > a:hover {
    background-color: #edf2f7 !important;
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: #fff !important;
}

.nav-tabs > li > a {
    border-radius: 8px 8px 0 0 !important;
    font-weight: 500;
}

/* --- Dashboard Kacheln --- */
a.dashboard {
    transition: transform 0.15s, box-shadow 0.15s;
    border-radius: 10px;
}

a.dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

/* --- Container --- */
.container {
    max-width: 100%;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

/* Dashboard: feste Breite beibehalten */
[data-dashboard] {
    max-width: 1200px;
}

/* --- Tabellen-Wrapper für horizontales Scrollen --- */
.grid-view-scroll-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.grid-view .table {
    min-width: 100%;
}

.grid-view .table td,
.grid-view .table th {
    white-space: nowrap;
}

/* --- Überschriften --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #1a202c;
}

h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

/* --- Links --- */
a {
    color: #2b6cb0;
    transition: color 0.15s;
}

a:hover {
    color: #1a4e8a;
    text-decoration: none;
}

/* --- Badges / Labels --- */
.label {
    border-radius: 6px !important;
    font-weight: 500;
    padding: 4px 8px !important;
    font-size: 11.5px;
}

.badge {
    border-radius: 20px !important;
    font-weight: 600;
    padding: 3px 9px !important;
}

/* --- Grid Filter Inputs --- */
.filters .form-control,
.form-special-b {
    border-radius: 6px !important;
    font-size: 12.5px !important;
    padding: 4px 8px !important;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c9d2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aab4;
}

/* --- Fixed Table Header --- */
.fixed-thead-wrap {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    overflow: hidden;
    display: none;
}

.fixed-thead-wrap table {
    margin-bottom: 0;
    table-layout: fixed;
}

.fixed-thead-wrap thead th {
    background-color: #f7fafc !important;
    overflow: hidden;
}

.fixed-thead-wrap .filters td {
    background-color: #fff !important;
}

/* Fixer Scrollbalken am unteren Bildschirmrand */
.fixed-scroll-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow-x: auto;
    overflow-y: hidden;
    background: #e2e8f0;
    height: 14px;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
}

.fixed-scroll-wrap::-webkit-scrollbar {
    height: 14px;
}

.fixed-scroll-wrap::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.fixed-scroll-wrap::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 7px;
    border: 2px solid #e2e8f0;
}

.fixed-scroll-wrap::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.fixed-scroll-inner {
    height: 1px;
}

/* --- Zellen minimieren / maximieren --- */
.grid-view .table td .cell-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    display: block;
}

.grid-view .table td .cell-truncate.cell-expanded {
    max-width: none;
    white-space: normal;
    word-break: break-word;
}

/* --- Map Buttons aktiv/inaktiv --- */
#button_location.turned-on,
#button_startvector.turned-on {
    background: #28a745 !important;
    color: #fff !important;
    border-color: #28a745 !important;
}

#button_location.turned-on .tx,
#button_startvector.turned-on .tx {
    color: #fff !important;
}

/* --- Footer --- */
footer p {
    color: #a0aec0;
    font-size: 13px;
}

/* --- Selection Color --- */
::selection {
    background: #c6f6d5;
    color: #1a202c;
}
