/* Custom CSS for ROW Management Application - PWT */

/* Global Styles */
:root {
    /* Official MPWT Brand Colors - Matching Logo */
    --mpwt-blue: #00a2e8;           /* Bright sky blue from logo */
    --mpwt-blue-dark: #0077b6;      /* Darker blue for hover states */
    --mpwt-yellow: #f9d71c;         /* Yellow/gold from logo oval */
    --mpwt-yellow-dark: #e6c200;    /* Darker yellow for hover */
    --mpwt-gray: #6b7280;           /* Road gray */
    --mpwt-dark-gray: #374151;      /* Dark text */
    --mpwt-light-gray: #f3f4f6;     /* Light backgrounds */
    
    /* Government Colors - Logo Based */
    --government-blue: #00a2e8;     /* Primary - sky blue */
    --government-gold: #f9d71c;     /* Secondary - yellow */
    
    /* Overriding Bootstrap color variables */
    --bs-primary: #00a2e8;
    --bs-primary-rgb: 0, 162, 232;
    --bs-secondary: #f9d71c;
    --bs-secondary-rgb: 249, 215, 28;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    
    /* Aliases for convenience */
    --primary-color: var(--mpwt-blue);
    --secondary-color: var(--mpwt-yellow);
    --accent-color: var(--mpwt-blue-dark);
    --warning-color: var(--bs-warning);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --light-color: var(--bs-light);
    --dark-color: var(--mpwt-dark-gray);
    
    /* Custom colors */
    --card-border-radius: 0.75rem;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-bottom: 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Bootstrap Primary Button Override - Logo Blue */
.btn-primary {
    background-color: var(--mpwt-blue) !important;
    border-color: var(--mpwt-blue) !important;
    color: white !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--mpwt-blue-dark) !important;
    border-color: var(--mpwt-blue-dark) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 162, 232, 0.4);
}

.btn-outline-primary {
    color: var(--mpwt-blue) !important;
    border-color: var(--mpwt-blue) !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--mpwt-blue) !important;
    border-color: var(--mpwt-blue) !important;
    color: white !important;
}

/* Bootstrap Secondary Button Override - Logo Yellow */
.btn-secondary {
    background-color: var(--mpwt-yellow) !important;
    border-color: var(--mpwt-yellow) !important;
    color: #333 !important;
}

.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
    background-color: var(--mpwt-yellow-dark) !important;
    border-color: var(--mpwt-yellow-dark) !important;
    color: #333 !important;
    box-shadow: 0 4px 12px rgba(249, 215, 28, 0.4);
}

/* Background color utilities */
.bg-primary {
    background-color: var(--mpwt-blue) !important;
}

.bg-secondary {
    background-color: var(--mpwt-yellow) !important;
}

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

/* Badge colors */
.badge.bg-primary {
    background-color: var(--mpwt-blue) !important;
}

.badge.bg-secondary {
    background-color: var(--mpwt-yellow) !important;
    color: #333 !important;
}

/* Link colors */
a {
    color: var(--mpwt-blue);
}

a:hover {
    color: var(--mpwt-blue-dark);
}

/* Clean Header Styles */
.header-clean {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    height: 50px;
    width: auto;
    margin-right: 1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mpwt-blue);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--mpwt-gray);
    line-height: 1.2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link-public {
    color: var(--mpwt-blue);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link-public:hover {
    background: rgba(0, 162, 232, 0.1);
    color: var(--mpwt-blue);
}

.language-selector .lang-btn {
    background: var(--mpwt-light-gray);
    border: 1px solid var(--mpwt-gray);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--mpwt-dark-gray);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.language-selector .lang-btn:hover {
    background: rgba(0, 162, 232, 0.1);
    border-color: var(--mpwt-blue);
}

.login-btn {
    background: var(--mpwt-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--mpwt-blue);
}

.login-btn:hover {
    background: var(--mpwt-blue-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 162, 232, 0.3);
}

/* Responsive header */
@media (max-width: 768px) {
    .header-clean {
        padding: 0.75rem 0;
    }
    
    .brand-logo {
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .brand-title {
        font-size: 1.2rem;
    }
    
    .brand-subtitle {
        font-size: 0.8rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .login-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .brand-subtitle {
        display: none;
    }
}

/* Modern card styling */
.card {
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    border: none;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

/* Dashboard specific styling */
.dashboard-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 162, 232, 0.1);
}

.dashboard-card:hover {
    border-color: var(--mpwt-blue);
    box-shadow: 0 8px 25px rgba(0, 162, 232, 0.15);
}

.dashboard-stats {
    background: linear-gradient(135deg, var(--mpwt-blue) 0%, var(--mpwt-blue-dark) 100%);
    border: none;
    color: white;
}

.dashboard-stats .card-body {
    padding: 2rem;
}

.dashboard-quick-actions {
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
    border: 1px solid #e0e0e0;
}

.quick-action-btn {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    padding: 1.5rem;
    text-decoration: none;
    display: block;
    color: inherit;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.btn-collect-data {
    background: linear-gradient(135deg, var(--mpwt-blue) 0%, var(--mpwt-blue-dark) 100%);
    color: white;
}

.btn-register-property {
    background: linear-gradient(135deg, var(--mpwt-yellow) 0%, var(--mpwt-yellow-dark) 100%);
    color: #333;
}

.btn-view-reports {
    background: linear-gradient(135deg, #28a745 0%, #20963d 100%);
    color: white;
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

/* Header & Navigation */
.navbar {
    transition: all var(--transition-speed);
}

.navbar-dark .navbar-toggler {
    border-color: transparent;
}

.navbar-dark .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.15);
}

.navbar-toggler {
    padding: 0.5rem;
    border-radius: 0.5rem;
}

/* Mobile navigation enhancements */
@media (max-width: 992px) {
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
    
    .navbar-collapse {
        background-color: var(--mpwt-blue);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
    }
    
    .navbar-nav .nav-link:hover, 
    .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu {
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    .dropdown-item {
        padding: 0.75rem 1.5rem;
    }
}

/* Offline indicator */
#offline-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--warning-color);
    color: #000;
    padding: 0.5rem;
    text-align: center;
    z-index: 1000;
    font-weight: bold;
    display: none;
}

/* Map styles */
#map-container {
    height: 500px;
    width: 100%;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.map-filters {
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 5px;
    margin-bottom: 1rem;
}

.custom-map-marker i {
    color: var(--primary-color);
    font-size: 24px;
}

.map-popup {
    max-width: 200px;
}

.map-popup h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.map-popup p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* Map message displays */
.map-offline-message,
.map-error-message,
.map-no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    background-color: var(--light-color);
    border-radius: 5px;
}

.map-offline-message i,
.map-error-message i,
.map-no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.map-offline-message i {
    color: var(--warning-color);
}

.map-error-message i {
    color: var(--danger-color);
}

.map-no-data-message i {
    color: var(--info-color);
}

/* Form styles */
.data-collection-form {
    background-color: var(--bs-dark);
    padding: 2rem;
    border-radius: var(--card-border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-speed);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.form-section-title::after {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 0.5rem;
}

.form-control, .form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    color: var(--bs-light);
    transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-select option {
    background-color: #fff;
    color: #212529;
}

/* Filter section form controls - ensure readable text on light backgrounds */
#filterSection .form-control,
#filterSection .form-select,
#filter-form .form-control,
#filter-form .form-select {
    background-color: #fff;
    color: #212529;
    border: 1px solid #ced4da;
}

#filterSection .form-control:focus,
#filterSection .form-select:focus,
#filter-form .form-control:focus,
#filter-form .form-select:focus {
    background-color: #fff;
    color: #212529;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#filterSection .form-label,
#filter-form .form-label {
    color: #212529;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--bs-gray-300);
}

/* Ensure labels are visible on blue/primary backgrounds */
.bg-primary .form-label,
.card-header.bg-primary .form-label,
.bg-primary label,
.bg-info .form-label,
.bg-info label,
.stat-card .form-label,
.dashboard-card-header .form-label {
    color: #ffffff !important;
}

/* Ensure form controls are readable on blue/primary backgrounds */
.bg-primary .form-control,
.bg-primary .form-select,
.bg-info .form-control,
.bg-info .form-select,
.card-header.bg-primary .form-control,
.card-header.bg-primary .form-select {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.bg-primary .form-control:focus,
.bg-primary .form-select:focus,
.bg-info .form-control:focus,
.bg-info .form-select:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* Ensure labels are visible in primary-colored sections */
.stat-card .form-label,
.dashboard-stat-card .form-label,
.data-collection-form .form-label {
    color: #ffffff;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.image-preview-container img {
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-speed);
    max-width: 150px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.image-preview-container img:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* GPS status indicator */
.gps-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-speed);
}

.gps-indicator:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.gps-indicator span {
    margin-left: 0.5rem;
    font-weight: 500;
}

.gps-indicator .badge {
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.7rem;
}

/* Data card styles */
.data-card {
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.data-card-header {
    padding: 1rem;
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.data-card-body {
    padding: 1rem;
}

/* Dashboard styles */
.dashboard-stat-card {
    border-radius: var(--card-border-radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dashboard-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    z-index: -1;
    transition: opacity 0.3s;
}

.dashboard-stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 60%);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dashboard-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2);
}

.dashboard-stat-card:hover::after {
    transform: scale(1);
}

.dashboard-stat-card .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dashboard-stat-card .stat-icon {
    font-size: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card .stat-icon i {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--pwt-blue) 0%, var(--pwt-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-stat-card .stat-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 162, 232, 0.1) 0%, rgba(255, 222, 0, 0.1) 100%);
    z-index: 1;
}

.dashboard-stat-card .stat-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
}

.dashboard-stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1;
    letter-spacing: -0.5px;
}

.dashboard-stat-card .stat-label {
    font-size: 1rem;
    color: var(--bs-gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.dashboard-stat-card .stat-footer {
    margin-top: auto;
    font-size: 0.875rem;
}

.dashboard-stat-card .stat-footer .badge {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Modern table styles */
.modern-table .table {
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table .table-dark th {
    border-bottom: none;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    background-color: rgba(0, 0, 0, 0.5);
}

.modern-table .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.modern-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.modern-table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.status-indicator.synced {
    background-color: rgba(40, 167, 69, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-indicator.pending {
    background-color: rgba(255, 222, 0, 0.15);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-indicator i {
    margin-right: 0.25rem;
}

/* Empty state styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mpwt-blue) 0%, var(--mpwt-yellow) 100%);
    font-size: 2rem;
    color: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 1.5rem;
}

/* System status list styling */
.system-status-list {
    padding: 1rem 0;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

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

.status-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.status-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0, 162, 232, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--mpwt-blue);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-item-content {
    flex-grow: 1;
}

.status-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--bs-gray-400);
}

.status-item-value {
    font-weight: 600;
    color: white;
}

.status-item-detail {
    font-size: 0.875rem;
    color: var(--bs-gray-300);
}

/* Modern carousel enhancements */
.modern-carousel {
    border-radius: var(--card-border-radius);
    overflow: hidden;
}

.carousel-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;
}

.carousel-image-wrapper img {
    height: 300px;
    object-fit: cover;
}

.carousel-caption {
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    border-radius: 0 0 var(--card-border-radius) var(--card-border-radius);
    padding: 2rem 1rem 1rem;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: left;
}

.carousel-caption h5 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

.carousel-caption p {
    font-size: 0.875rem;
    margin-bottom: 0;
    opacity: 0.8;
}

.carousel-indicators {
    margin-bottom: 0.5rem;
}

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    margin: 0 4px;
}

.carousel-indicators .active {
    background-color: var(--pwt-blue);
}

/* Activity row animations */
.activity-row {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Sync styles */
.sync-item {
    transition: background-color 0.3s;
}

.sync-item.syncing {
    background-color: rgba(23, 162, 184, 0.1);
}

.sync-item.sync-success {
    background-color: rgba(40, 167, 69, 0.1);
}

.sync-item.sync-error {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Language selector */
.language-selector {
    margin-left: 1rem;
}

/* Mobile touch interaction enhancements */
@media (max-width: 992px) {
    /* Increase touch target sizes */
    .btn, button, .nav-link, a.list-group-item, .form-check-label {
        cursor: pointer;
        touch-action: manipulation;
    }
    
    /* Add active state for touch */
    .btn:active, .nav-link:active, a.list-group-item:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }
    
    /* Ensure form elements are easily tappable */
    .form-control, .form-select, input, select, textarea {
        min-height: 3rem;
        font-size: 1rem;
    }
    
    /* Improve button spacing on mobile */
    .btn {
        padding: 0.625rem 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    /* Ensure form labels are visible */
    .form-label {
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .data-collection-form {
        padding: 1.5rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .dashboard-stat-card {
        min-height: 150px;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #map-container {
        height: 300px;
    }
    
    .dashboard-stat-card {
        min-height: 120px;
    }
    
    .dashboard-stat-card i {
        font-size: 2rem;
    }
    
    .dashboard-stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm > .btn, .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    .dashboard-stat-card {
        min-height: 100px;
        padding: 1.25rem 1rem;
    }
    
    .dashboard-stat-card i {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    .dashboard-stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    .dashboard-stat-card .stat-label {
        font-size: 0.875rem;
    }
    
    .data-collection-form {
        padding: 1.25rem;
    }
    
    .image-preview-container img {
        max-width: 100px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Simple Dropdown Menu */
.simple-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    z-index: 1000 !important;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    min-width: 160px !important;
    padding: 0.5rem 0 !important;
    margin: 0.125rem 0 0 !important;
    font-size: 0.875rem !important;
    color: #212529 !important;
}

.simple-dropdown.dropdown-floating {
    position: fixed !important;
    top: var(--dropdown-top) !important;
    left: var(--dropdown-left) !important;
    right: auto !important;
    z-index: 9999 !important;
    margin: 0 !important;
}

.simple-dropdown .dropdown-item {
    display: block !important;
    width: 100% !important;
    padding: 0.375rem 1rem !important;
    clear: both !important;
    font-weight: 400 !important;
    color: #212529 !important;
    text-align: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    background-color: transparent !important;
    border: 0 !important;
    cursor: pointer !important;
}

.simple-dropdown .dropdown-item:hover {
    background-color: #e9ecef !important;
    color: #1e2125 !important;
}

.simple-dropdown .dropdown-divider {
    height: 0 !important;
    margin: 0.5rem 0 !important;
    overflow: hidden !important;
    border-top: 1px solid #dee2e6 !important;
}

/* Fix parent container overflow */
.card .dropdown {
    overflow: visible !important;
}

.card .dropdown .dropdown-menu {
    overflow: visible !important;
}

/* Ensure card body doesn't clip dropdown */
.card-body {
    overflow: visible !important;
}

.card {
    overflow: visible !important;
}

/* Property card specific overflow fixes */
.property-card {
    overflow: visible !important;
    z-index: 1;
    margin-bottom: 1rem !important;
    position: relative;
}

.property-card.dropdown-active {
    z-index: 1050 !important;
}

.property-card:hover {
    z-index: 10;
}

.property-card .dropdown {
    overflow: visible !important;
}

.property-card .dropdown-menu {
    overflow: visible !important;
}

/* Add spacing between property cards to accommodate dropdown */
.property-card + .property-card {
    margin-top: 1rem !important;
}

/* Owner card container overflow fixes */
.owner-card {
    overflow: visible !important;
}

.owner-card .card-body {
    overflow: visible !important;
}

.owner-card .row,
.owner-card .col-lg-6 {
    overflow: visible !important;
}

/* Row and column overflow fixes */
.row {
    overflow: visible !important;
}

.col-12 {
    overflow: visible !important;
}

.col-md-6 {
    overflow: visible !important;
}

.col-lg-4 {
    overflow: visible !important;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease-in-out;
    display: block;
    width: 100%;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(0, 162, 232, 0.1);
    color: #1e2125;
}

.dropdown-item.text-danger:hover, .dropdown-item.text-danger:focus {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.dropdown-divider {
    margin: 0.5rem 0;
    height: 0;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Ensure dropdowns appear above other elements */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    padding: 0.375rem 0.75rem;
    border: 1px solid rgba(0, 162, 232, 0.3);
    background-color: transparent;
    color: #0d6efd;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.dropdown-toggle:hover {
    background-color: rgba(0, 162, 232, 0.1);
    border-color: rgba(0, 162, 232, 0.5);
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 162, 232, 0.25);
}

/* Fix for dropdown positioning in card layouts */
.card .dropdown {
    position: relative;
}

.card .dropdown-menu {
    position: absolute;
    will-change: transform;
}

/* Force dropdown to stay in place */
.dropdown-menu.show {
    display: block;
    position: absolute;
    inset: 0px auto auto 0px;
    margin: 0;
    transform: translate(0px, 38px);
}

/* Right-aligned dropdown menu */
.dropdown-menu-end {
    --bs-position: end;
    right: 0 !important;
    left: auto !important;
}

.dropdown-menu.dropdown-menu-end.show {
    position: absolute;
    inset: 0px 0px auto auto;
    margin: 0;
    transform: translate(0px, 38px);
}

/* Ensure proper positioning for property card dropdowns */
.card .dropdown .dropdown-menu {
    position: absolute;
    z-index: 1000;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Footer */
footer {
    margin-top: 2rem;
    padding: 1rem 0;
    background-color: var(--light-color);
    text-align: center;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Lao language specific adjustments */
[lang="lo"] {
    font-family: 'Phetsarath OT', 'Saysettha OT', 'Lao UI', sans-serif;
    line-height: 1.6;
}

/* Accessibility focus states */
a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* MPWT branded buttons */
.btn-yellow {
    background-color: var(--mpwt-yellow);
    color: #333;
    border: none;
    font-weight: 600;
}

.btn-yellow:hover, .btn-yellow:focus {
    background-color: var(--mpwt-yellow-dark);
    color: #333;
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(249, 215, 28, 0.5);
}

.btn-mpwt-blue {
    background-color: var(--mpwt-blue);
    color: white;
    border: none;
    font-weight: 600;
}

.btn-mpwt-blue:hover, .btn-mpwt-blue:focus {
    background-color: var(--mpwt-blue-dark);
    color: white;
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0, 162, 232, 0.5);
}

/* MPWT outline buttons */
.btn-outline-mpwt-yellow {
    color: var(--mpwt-yellow-dark);
    border: 2px solid var(--mpwt-yellow);
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-mpwt-yellow:hover, .btn-outline-mpwt-yellow:focus {
    background-color: var(--mpwt-yellow);
    color: #333;
    box-shadow: 0 4px 12px rgba(249, 215, 28, 0.3);
}

.btn-outline-mpwt-blue {
    color: var(--mpwt-blue);
    border: 2px solid var(--mpwt-blue);
    background-color: transparent;
    font-weight: 600;
}

.btn-outline-pwt-blue:hover, .btn-outline-pwt-blue:focus {
    background-color: var(--pwt-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 162, 232, 0.3);
}

/* PWT gradient styles */
.bg-gradient-pwt {
    background: linear-gradient(135deg, var(--pwt-blue) 0%, var(--pwt-blue) 50%, var(--pwt-yellow) 150%);
}

.text-gradient-pwt {
    background: linear-gradient(135deg, var(--pwt-blue) 0%, var(--pwt-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile-First Responsive Styles */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .form-floating {
        margin-bottom: 1rem;
    }
    
    .nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        display: inline-block;
        min-width: 120px;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        flex-shrink: 0;
    }
    
    .tab-content {
        padding: 1rem 0.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1.1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px; /* Touch-friendly size */
    }
    
    .btn {
        min-height: 44px;
        margin-bottom: 0.5rem;
    }
    
    #map {
        height: 250px !important;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
        vertical-align: middle;
    }
    
    .d-grid .btn {
        width: 100%;
    }
}

/* Touch-friendly improvements */
.btn-group-vertical .btn {
    border-radius: 6px !important;
    margin-bottom: 0.25rem;
}

/* Photo capture mobile styles */
.camera-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile dashboard cards */
.dashboard-stat-card {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ========================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile-First: Base Mobile Styles (0-767px) */
@media (max-width: 767px) {
    /* Container adjustments */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Typography scaling */
    h1, .h1 { font-size: 1.75rem; line-height: 1.2; }
    h2, .h2 { font-size: 1.5rem; line-height: 1.3; }
    h3, .h3 { font-size: 1.25rem; line-height: 1.4; }
    h4, .h4 { font-size: 1.1rem; }
    h5, .h5 { font-size: 1rem; }
    
    /* Touch-friendly buttons - minimum 44px tap targets */
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 0.875rem 1.5rem;
        font-size: 1.125rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Form inputs - prevent iOS zoom, touch-friendly sizing */
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 48px;
        padding: 0.75rem 1rem;
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    /* Form labels - larger for readability */
    .form-label {
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    /* Cards - full width, reduced shadows */
    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Dashboard stat cards - stack vertically */
    .dashboard-stat-card {
        min-height: auto;
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }
    
    .dashboard-stat-card .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }
    
    .dashboard-stat-card .stat-value {
        font-size: 2rem;
    }
    
    .dashboard-stat-card .stat-label {
        font-size: 0.875rem;
    }
    
    /* Tables - horizontal scroll with touch indicators */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    .table th {
        position: sticky;
        top: 0;
        background-color: var(--bs-dark);
        z-index: 10;
    }
    
    /* Map containers - responsive height */
    #map,
    #map-container,
    .map-container {
        height: 300px !important;
        min-height: 300px;
        margin-bottom: 1rem;
    }
    
    /* Map controls - larger for touch */
    .leaflet-control-zoom a {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        font-size: 20px !important;
    }
    
    /* Quick action buttons - full width */
    .quick-action-btn {
        padding: 1.25rem;
        margin-bottom: 1rem;
        width: 100%;
        display: block;
        text-align: left;
    }
    
    .quick-action-btn i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    /* Modal dialogs - full screen on mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    /* Dropdowns - larger touch targets */
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu {
        font-size: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Navigation tabs - scrollable */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        min-width: 120px;
        text-align: center;
    }
    
    /* Badges - slightly larger */
    .badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Image previews - responsive grid */
    .image-preview-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .image-preview-container img {
        width: 100%;
        height: 100px;
        object-fit: cover;
        border-radius: 0.5rem;
    }
    
    /* Form sections - better spacing */
    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .form-section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Data collection form - mobile optimized */
    .data-collection-form {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* GPS indicator - full width */
    .gps-indicator {
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    /* Status indicators */
    .status-indicator {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Alert messages */
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.938rem;
        border-radius: 0.5rem;
    }
    
    /* Breadcrumb navigation */
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        flex-wrap: wrap;
    }
    
    .breadcrumb-item {
        padding: 0.25rem 0;
    }
    
    /* Footer - better mobile layout */
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.875rem;
    }
    
    footer .row {
        text-align: center !important;
    }
    
    footer .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Signature pads - full width */
    .signature-pad {
        width: 100% !important;
        max-width: 100%;
        height: 200px;
        border: 2px solid #dee2e6;
        border-radius: 0.5rem;
        touch-action: none;
    }
    
    /* Property cards - mobile optimized */
    .property-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Owner cards - full width */
    .owner-card {
        margin-bottom: 1rem;
    }
    
    /* Filters - collapsible on mobile */
    .filter-container {
        margin-bottom: 1rem;
    }
    
    .filter-container .card-body {
        padding: 1rem;
    }
    
    /* Chart containers - responsive */
    canvas {
        max-width: 100%;
        height: auto !important;
    }
    
    .chart-container {
        position: relative;
        height: 250px;
        margin-bottom: 1rem;
    }
    
    /* List groups - touch-friendly */
    .list-group-item {
        padding: 0.875rem 1rem;
        min-height: 52px;
    }
    
    /* Pagination - compact */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Input groups - stack on mobile */
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group > .form-control,
    .input-group > .form-select {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    .input-group-text {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Action buttons - sticky bottom */
    .action-buttons-sticky {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        margin-left: -1rem;
        margin-right: -1rem;
        z-index: 100;
    }
    
    .action-buttons-sticky .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Small Mobile Devices (0-575px) */
@media (max-width: 575px) {
    /* Extra small screens - reduce padding further */
    .container, .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Even more compact typography */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.375rem; }
    h3, .h3 { font-size: 1.125rem; }
    
    /* Cards - minimal padding */
    .card-body {
        padding: 0.875rem;
    }
    
    /* Tables - smaller font */
    .table {
        font-size: 0.813rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
    }
    
    /* Dashboard cards - compact */
    .dashboard-stat-card {
        padding: 1rem 0.875rem;
    }
    
    .dashboard-stat-card .stat-value {
        font-size: 1.75rem;
    }
    
    /* Map - minimum usable height */
    #map,
    #map-container,
    .map-container {
        height: 250px !important;
        min-height: 250px;
    }
}

/* Tablet Devices (768px-991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* 2-column grid for dashboard cards */
    .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Tables - better spacing */
    .table th,
    .table td {
        padding: 0.875rem 0.75rem;
    }
    
    /* Forms - 2-column layout for some fields */
    .form-row-tablet {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Maps - larger but not full desktop */
    #map,
    #map-container,
    .map-container {
        height: 400px !important;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 896px) and (orientation: landscape) {
    /* Optimize for landscape orientation */
    .modal-dialog {
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
    }
    
    /* Maps - taller in landscape */
    #map,
    #map-container,
    .map-container {
        height: 350px !important;
    }
    
    /* Forms - side-by-side in landscape */
    .form-landscape-2col {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    /* Hide navigation and interactive elements */
    .sidebar,
    .mobile-navbar,
    .btn,
    button,
    .dropdown,
    .action-buttons-sticky,
    #offline-indicator {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    /* Expand all sections */
    .card,
    .collapse {
        display: block !important;
        page-break-inside: avoid;
    }
    
    /* Remove shadows and backgrounds */
    .card,
    .table {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    /* Black and white for text */
    body {
        color: #000 !important;
        background: #fff !important;
    }
}

/* High DPI/Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high-density displays */
    .card,
    .btn,
    .form-control {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support (if enabled) */
@media (prefers-color-scheme: dark) {
    /* This is placeholder for future dark mode support */
    /* Currently the app uses dark theme by default */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Device is touch-only (no mouse) */
    
    /* Larger touch targets */
    a, button, .btn, .nav-link, .dropdown-item {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Remove hover states (they stick on touch) */
    .card:hover,
    .btn:hover,
    .nav-link:hover {
        transform: none;
    }
    
    /* Add active/pressed states instead */
    .btn:active,
    .nav-link:active,
    .card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Better scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    
    /* Fix for iOS input zoom */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Fix for iOS 100vh issue */
    .modal-dialog {
        min-height: -webkit-fill-available;
    }
    
    /* Prevent iOS scroll bounce on fixed elements */
    .sidebar,
    .mobile-navbar {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Android Specific Fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
    /* Android Chrome specific styles */
    
    /* Better select dropdowns */
    select {
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.75rem center;
        background-size: 16px;
        padding-right: 2.5rem;
    }
}
