/**
 * HGen+ Custom Styles
 * Extends Tailwind CSS with custom components
 */

/* Base styles */
:root {
    --hgenplus-primary: #2563eb;
    --hgenplus-secondary: #64748b;
    --hgenplus-malay: #22c55e;
    --hgenplus-chinese: #f97316;
    --hgenplus-indian: #3b82f6;
    --hgenplus-company: #1f2937;
    --hgenplus-other: #6b7280;
}

/* Loader animation */
.loader {
    border-top-color: var(--hgenplus-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Map marker styles */
.custom-marker {
    background: var(--hgenplus-primary);
    border: 3px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.custom-marker.malay { background: var(--hgenplus-malay); }
.custom-marker.chinese { background: var(--hgenplus-chinese); }
.custom-marker.indian { background: var(--hgenplus-indian); }
.custom-marker.company { background: var(--hgenplus-company); }

/* Leaflet popup custom styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 8px 12px;
}

/* Sidebar transition */
.sidebar-panel {
    transition: transform 0.3s ease;
}

.sidebar-panel.hidden-panel {
    transform: translateX(100%);
}

/* Demographics bar animation */
.demo-bar {
    transition: width 0.5s ease-out;
}

/* Table hover effects */
.result-row {
    transition: background-color 0.15s ease;
}

.result-row:hover {
    background-color: #f8fafc;
}

/* Button hover effects */
.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* Card hover effects */
.hover-card {
    transition: all 0.2s ease;
}

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

/* Search input focus */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar-panel {
        width: 100% !important;
    }
    
    #map {
        height: calc(100vh - 56px);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-full {
        width: 100% !important;
    }
}
