/* PowerMap Custom Styles */

/* Stat icons */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Feather icon sizes */
.feather-sm {
    width: 14px;
    height: 14px;
}

.feather-lg {
    width: 48px;
    height: 48px;
}

.feather-icon {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
}

/* Photo preview grid */
#photoPreview img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Toast container positioning */
.toast-container {
    z-index: 9999 !important;
}

/* Modal z-index fixes - ensure modals appear above all page content */
.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
    position: fixed !important;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Ensure wrapper doesn't create stacking context issues */
.wrapper {
    position: relative;
    z-index: 1;
}

/* Map containers */
#mapPreview,
#miniMap {
    border-radius: 0.25rem;
}

/* Loading overlay */
#loadingOverlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Sticky card on scroll */
.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 100;
}

/* Better table responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Badge adjustments */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Activity feed styling */
.activity-feed .activity-item {
    border-left: 2px solid #e9ecef;
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.activity-feed .activity-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0d6efd;
    border: 2px solid #fff;
}

/* Card hover effects */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Progress bar animations */
.progress-bar {
    transition: width 0.6s ease;
}

/* Button loading state */
.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Improve form control focus */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}



/* Responsive utilities */
@media (max-width: 768px) {
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    h1.h3 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .footer {
        display: none !important;
    }
    
    .main {
        width: 100% !important;
    }
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Custom primary color variations */
.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.bg-primary-light {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.text-primary-dark {
    color: #0a58ca !important;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-dot.active {
    background-color: #198754;
}

.status-dot.inactive {
    background-color: #6c757d;
}

.status-dot.pending {
    background-color: #ffc107;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* -------------------------------------------------- */
/* Mobile Enhancements                                */
/* -------------------------------------------------- */

/* Sidebar overlay removed per user request */

/* Desktop sidebar behavior */
@media (min-width: 992px) {
    .sidebar.js-sidebar {
        transition: margin-left 0.25s ease, width 0.25s ease;
    }
    
    .sidebar.js-sidebar.collapsed {
        margin-left: -260px;
    }
    
}

/* Mobile sidebar behavior - off-canvas */
@media (max-width: 991.98px) {
    .sidebar.js-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        max-width: 85%;
        background: #ffffff;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        transform: translateX(0);
        transition: transform 0.3s ease-in-out;
        z-index: 1040;
        margin-left: 0 !important;
    }
    
    .sidebar.js-sidebar.collapsed {
        transform: translateX(-100%);
        box-shadow: none;
    }
    
    .main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .wrapper {
        position: relative;
        overflow-x: hidden;
    }
    
    /* Tighter spacing on mobile */
    .card { 
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Smaller stat cards */
    .col-xl-2, .col-xl-3 {
        min-width: 50%;
    }
    
    /* Stack user progress columns */
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    
    /* Make dropdowns full width on mobile */
    .navbar .dropdown-menu {
        position: absolute;
        max-width: 95vw;
    }
    
    /* Utility: hide on mobile */
    .hide-mobile { 
        display: none !important; 
    }
    
    /* Utility: show only on mobile */
    .show-mobile { 
        display: block !important; 
    }
}

/* Ultra-small devices adjustments */
@media (max-width: 575.98px) {
    .navbar .dropdown-menu { position: absolute; }
    h1.h3 { font-size: 1.35rem; }
    .badge { font-size: 0.65rem; }
    .stat-icon { width: 36px; height: 36px; }
    .table td, .table th { font-size: 0.75rem; }
}

/* Responsive text truncation improvements */
@media (max-width: 480px) {
    .text-truncate-2, .text-truncate-3 { -webkit-line-clamp: 2; }
}

/* Accessible touch targets enhancement */
@media (hover: none) and (pointer: coarse) {
    .btn, .nav-link, .sidebar-link { min-height: 44px; }
}
