/* 
 * Modern App-like CSS for Immobilienverwaltung
 * Using grayscale color palette with iconography focus
 */

:root {
    /* Custom grayscale color palette */
    --app-dark: #212529;
    --app-gray-900: #212529;
    --app-gray-800: #343a40;
    --app-gray-700: #495057;
    --app-gray-600: #6c757d;
    --app-gray-500: #adb5bd;
    --app-gray-400: #ced4da;
    --app-gray-300: #dee2e6;
    --app-gray-200: #e9ecef;
    --app-gray-100: #f8f9fa;
    /* Changed accent from blue to dark gray */
    --app-accent: #495057; 
    --app-success: #198754;
    --app-danger: #dc3545;
    --app-warning: #ffc107;
    --bs-primary: #495057; /* Override Bootstrap primary color */
    --bs-primary-rgb: 73, 80, 87; /* RGB value for --app-gray-700 */
}

/* Layout für Sidebar und Content */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--app-gray-900);
    color: var(--app-gray-100);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
}

.content-container {
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
    padding: 1rem;
}

.footer {
    background-color: var(--app-gray-800) !important;
    border-top: 1px solid var(--app-gray-700);
    padding: 0.75rem 0;
    position: sticky;
    bottom: 0;
    width: 100%;
}

/* Dezenterer Footer-Text */
.footer-text {
    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.03em;
    color: var(--app-gray-600);
    opacity: 0.7;
}

/* Sidebar Mega-Menu Styling */
.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: -280px; /* Start with sidebar hidden on all devices */
    background-color: var(--app-gray-800);
    border-right: 1px solid var(--app-gray-700);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar.show {
    left: 0; /* Show sidebar when .show class is applied */
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--app-gray-700);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--app-gray-100);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.sidebar-toggler {
    display: none;
}

/* Profil in der Sidebar */
.sidebar-user {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--app-gray-700);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--app-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.avatar i {
    font-size: 1.5rem;
    color: var(--app-gray-300);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--app-gray-100);
}

.user-role {
    font-size: 0.75rem;
    color: var(--app-gray-400);
}

/* Navigation */
.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--app-gray-400);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-link:hover {
    color: var(--app-gray-100);
    background-color: var(--app-gray-700);
}

.sidebar-link.active {
    color: var(--app-gray-100);
    background-color: var(--app-accent);
}

/* Dropdown Menü */
.sidebar-dropdown {
    display: none;
    background-color: var(--app-gray-900);
    width: 100%;
}

.sidebar-dropdown.show {
    display: block;
}

.sidebar-link .dropdown-indicator {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-link.active .dropdown-indicator,
.sidebar-link.show .dropdown-indicator {
    transform: rotate(180deg);
}

.sidebar-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-dropdown ul li a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem 0.5rem 3.5rem;
    color: var(--app-gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-dropdown ul li a:hover {
    color: var(--app-gray-100);
    background-color: var(--app-gray-700);
}

.sidebar-dropdown ul li a i {
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--app-gray-700);
}

.language-selector {
    margin-bottom: 1rem;
}

.lang-label {
    color: var(--app-gray-400);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.lang-options {
    display: flex;
    gap: 0.5rem;
}

.lang-option {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: var(--app-gray-400);
    text-decoration: none;
    background-color: var(--app-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background-color: var(--app-gray-600);
    color: var(--app-gray-100);
}

.lang-option.active {
    background-color: var(--app-accent);
    color: white;
}

.sidebar-settings {
    display: flex;
    align-items: center;
    color: var(--app-gray-400);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.sidebar-settings i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.sidebar-settings:hover {
    color: var(--app-gray-100);
}

.sidebar-settings.active {
    color: var(--app-accent);
}

/* Backdrop für mobile Ansicht */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Sidebar Toggle Button (für alle Ansichten) */
.sidebar-toggler {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* Hauptinhalt-Container-Anpassung */
.content-container {
    margin-left: 0; /* Kein Margin, da Sidebar standardmäßig ausgeblendet ist */
    transition: margin-left 0.3s ease;
}

/* Main navigation toggle */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--app-gray-800);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1020;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: none;
    color: var(--app-gray-100);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

/* Sidebar Backdrop */
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Stile für geöffnete Sidebar */
.sidebar.show {
    left: 0;
}

/* Mobile-Anpassungen */
@media (max-width: 992px) {
    /* Keine zusätzlichen Anpassungen nötig, da die Basis-Styles für alle Ansichten gelten */
}

/* Modern Card Design */
.card {
    background-color: var(--app-gray-800);
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--app-gray-800);
    border-bottom: 1px solid var(--app-gray-700);
    padding: 1rem 1.25rem;
    border-top-left-radius: 0.75rem !important;
    border-top-right-radius: 0.75rem !important;
}

.card-body {
    padding: 1.5rem;
}

/* Dashboard Stat Cards */
.stat-card {
    text-align: center;
    border-radius: 0.75rem;
    transition: transform 0.2s ease;
}

.stat-card i.bi {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--app-gray-400);
}

.card-title {
    color: var(--app-gray-400);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--app-gray-100);
}

/* Table Styling */
.table {
    color: var(--app-gray-300);
    margin-bottom: 0;
}

.table th {
    border-top: none;
    border-bottom: 1px solid var(--app-gray-700);
    color: var(--app-gray-400);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.table td {
    border-top: none;
    border-bottom: 1px solid var(--app-gray-700);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--app-gray-700);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Button Styling */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.btn i {
    margin-right: 0.5rem;
}

/* Ripple effect for buttons - mobile app like touch feedback */
.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    pointer-events: none;
    animation: ripple-animation 0.6s linear;
    width: 100px;
    height: 100px;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-primary {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
}

.btn-secondary {
    background-color: var(--app-gray-700);
    border-color: var(--app-gray-700);
}

.btn-outline-secondary {
    color: var(--app-gray-300);
    border-color: var(--app-gray-600);
}

.btn-outline-secondary:hover {
    background-color: var(--app-gray-700);
    border-color: var(--app-gray-700);
}

/* Form Controls */
.form-control, .form-select {
    background-color: var(--app-gray-900);
    border: 1px solid var(--app-gray-700);
    color: var(--app-gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--app-gray-900);
    border-color: var(--app-accent);
    color: var(--app-gray-100);
    box-shadow: 0 0 0 0.25rem rgba(73, 80, 87, 0.25);
}

.form-control::placeholder {
    color: var(--app-gray-600);
}

.form-label {
    color: var(--app-gray-400);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Status & Type Indicators */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
}

/* Currency formatting */
.currency-eur::before {
    content: "€";
}

.currency-try::before {
    content: "₺";
}

/* Property Status Indicators */
.property-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.property-occupied {
    background-color: var(--app-success);
}

.property-vacant {
    background-color: var(--app-danger);
}

/* Payment Status Styling */
.payment-paid {
    color: var(--app-success);
}

.payment-partial {
    color: var(--app-warning);
}

.payment-pending {
    color: var(--app-danger);
}

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

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .navbar-collapse {
        background-color: var(--app-gray-800);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        margin-bottom: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    /* Center elements in forms and cards */
    .form-group, .card-header, .card-footer {
        text-align: center;
    }
    
    /* Adjust button groups in mobile view */
    .btn-group, .btn-group-sm {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .btn-group .btn, .btn-group-sm .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
    }
    
    /* Maximize screen usage in mobile view */
    .container, .container-fluid {
        padding-left: 5px;
        padding-right: 5px;
        max-width: 100%;
    }
    
    .row {
        margin-left: -3px;
        margin-right: -3px;
    }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, 
    .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, 
    .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, 
    .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, 
    .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, 
    .col-md-10, .col-md-11, .col-md-12 {
        padding-left: 3px;
        padding-right: 3px;
    }
    
    .card {
        margin-bottom: 8px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Reduce margins and padding for content */
    .content-container {
        padding: 0.5rem;
    }
    
    /* Adjust form elements for mobile */
    .form-control, .form-select, .input-group {
        margin-bottom: 0.5rem;
    }
    
    /* Center align headings */
    h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
        text-align: center;
    }
    
    /* Center buttons */
    .d-flex.justify-content-between {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Adjust table padding */
    .table td, .table th {
        padding: 0.5rem;
    }
}

/* Tab Navigation Styling */
.nav-tabs {
    border-bottom: 1px solid var(--app-gray-700);
}

.nav-tabs .nav-link {
    color: var(--app-gray-400);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1rem;
    margin-right: 1rem;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--app-gray-100);
    background-color: transparent;
    border-bottom: 2px solid var(--app-accent);
}

.nav-tabs .nav-link:hover:not(.active) {
    border-bottom: 2px solid var(--app-gray-600);
}

/* Iconography Focus */
.icon-lg {
    font-size: 2.5rem;
    opacity: 0.8;
}

.icon-action {
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--app-gray-500);
    transition: color 0.2s ease;
}

/* Dashboard country flags */
.country-flag {
    width: 32px;
    height: 24px;
    margin-right: 0.25rem;
}

.icon-action:hover {
    color: var(--app-gray-100);
}

/* Dropdown Styling */
.dropdown-menu {
    background-color: var(--app-gray-800);
    border: 1px solid var(--app-gray-700);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--app-gray-300);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--app-gray-700);
    color: var(--app-gray-100);
}

.dropdown-item.active {
    background-color: var(--app-accent);
    color: white;
}

/* Alert Styling */
.alert {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: none;
}

/* Dashboard Tables */
/* Diese Selektoren wurden durch direkte Bootstrap-Variablen ersetzt */

.table {
    color: var(--app-gray-300);
    background-color: var(--app-gray-900) !important;
    border-color: var(--app-gray-700);
    --bs-table-bg: var(--app-gray-900) !important;
    --bs-table-striped-bg: var(--app-gray-800) !important;
    --bs-table-hover-bg: var(--app-gray-700) !important;
    --bs-table-striped-color: var(--app-gray-300) !important;
    --bs-table-hover-color: var(--app-gray-200) !important;
}

/* Table header styling */
.table thead.bg-secondary {
    background-color: var(--app-gray-700) !important;
    color: var(--app-gray-200) !important;
}

.bg-light, .card-header.bg-light, .card.bg-light {
    background-color: var(--app-gray-900) !important;
    color: var(--app-gray-300) !important;
    border-color: var(--app-gray-700) !important;
}

/* Dashboard Chart Containers */
.chart-container-fixed {
    height: 180px;
    max-height: 180px;
    position: relative;
    margin-bottom: 0;
    overflow: hidden;
}

.chart-container-fixed canvas {
    max-height: 100%;
}

/* Styling for chart buttons */
.card-header .btn-outline-secondary {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-color: var(--app-gray-600);
    color: var(--app-gray-400);
}

.card-header .btn-outline-secondary:hover {
    background-color: var(--app-gray-700);
    color: var(--app-gray-100);
}