/**
 * HACA Boundary Finder CSS
 * Orange Theme (#ff6725)
 * Green for HACA Areas (#228B22)
 * Elegant design with full-screen interactive map
 */

:root {
    --haca-primary: #ff6725;
    --haca-primary-dark: #e55a1f;
    --haca-primary-light: #ff8c5c;
    --haca-green: #228B22;
    --haca-green-dark: #1a6b1a;
    --haca-green-light: #32CD32;
    --haca-secondary: #4a90e2;
    --haca-info: #17a2b8;
    --haca-success: #28a745;
    --haca-warning: #ffc107;
    --haca-danger: #dc3545;
}

/* Container and Layout */
.haca-zone-container {
    background: #fff;
    min-height: calc(100vh - 120px);
}

.haca-zone-content {
    padding: 20px 0;
}

/* Map Container - Full Screen Interactive Map */
#map {
    height: 600px !important;
    width: 100% !important;
    border-radius: 10px;
    border: 1px solid #ddd;
    position: relative;
    z-index: 1;
}

.map-container {
    position: relative;
    margin: 20px 0;
    width: 100%;
    height: 600px;
}

.map-wrapper {
    position: relative;
    background: #f5f5f5;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.haca-map {
    height: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Map Instruction Overlay */
.map-instruction {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 103, 37, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.map-instruction.visible {
    opacity: 1;
}

#mapInstruction {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#mapInstruction.visible {
    opacity: 1;
}

/* Search Box with Autocomplete */
.haca-search-container {
    position: relative;
}

.survey-map-search-container,
.map-controls-container {
    position: absolute !important;
    z-index: 500 !important;
}

.survey-map-search-container {
    top: 15px;
    left: 15px;
    width: 350px;
}

.map-controls-container {
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

#hacaSearchBox,
.survey-map-search-box {
    width: 100%;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid #ff6725;
    background: white;
    box-shadow: 0 3px 10px rgba(255, 103, 37, 0.15);
    font-size: 14px;
    transition: all 0.3s;
}

#hacaSearchBox:focus,
.survey-map-search-box:focus {
    outline: none;
    border-color: #ff8c5c;
    box-shadow: 0 3px 15px rgba(255, 103, 37, 0.25);
}

.haca-search-input {
    height: 48px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.haca-search-input:focus {
    border-color: var(--haca-primary);
    box-shadow: 0 0 0 3px rgba(255, 103, 37, 0.1);
    outline: none;
}

/* Search Results Dropdown - Autocomplete */
#hacaSearchResults,
.survey-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ff6725;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(255, 103, 37, 0.15);
    z-index: 600;
    display: none;
    margin-top: -2px;
}

.haca-search-result-item,
.survey-search-results div {
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    transition: all 0.2s;
    font-size: 14px;
}

.haca-search-result-item:hover,
.survey-search-results div:hover {
    background: #fff5f0;
    padding-left: 25px;
    color: #ff6725;
}

.haca-search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 13px 13px;
}

.haca-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Location Button */
#currentLocationBtn,
#findNearbyBtn,
.location-button {
    background: white;
    border: 2px solid #ff6725;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    box-shadow: 0 3px 10px rgba(255, 103, 37, 0.15);
    transition: all 0.3s;
    color: #ff6725;
    font-size: 18px;
}

#currentLocationBtn:hover,
#findNearbyBtn:hover,
.location-button:hover {
    background: linear-gradient(135deg, #ff6725, #ff8c5c);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 103, 37, 0.3);
}

#currentLocationBtn:active,
#findNearbyBtn:active,
.location-button:active {
    transform: translateY(0);
}

.btn-location {
    background: linear-gradient(135deg, var(--haca-primary) 0%, var(--haca-primary-light) 100%);
    color: white;
    height: 48px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-location:hover {
    background: linear-gradient(135deg, var(--haca-primary-dark) 0%, var(--haca-primary) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 103, 37, 0.3);
}

.btn-location.active {
    background: var(--haca-primary-dark);
    animation: pulse 1.5s infinite;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-map-control {
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid var(--haca-primary);
    border-radius: 10px;
    color: var(--haca-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-map-control:hover {
    background: var(--haca-primary);
    color: white;
    transform: scale(1.1);
}

/* Map Legend - Positioned Left, Compact Width 160px */
.map-legend,
#mapLegend {
    position: absolute !important;
    bottom: 20px !important;
    left: 20px !important;
    z-index: 1000 !important;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff672520;
    width: 160px;
}

.map-legend h6 {
    margin: 0 0 12px 0;
    color: #ff6725;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #2d3748;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.legend-color.haca-area {
    background: #228B22;
}

.legend-color.selected-location {
    background: #ff6725;
}

/* Loader - Centered on Map */
#loader {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    text-align: center;
    z-index: 9999;
    display: none;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#loader .loader-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 30px 40px;
    min-width: 280px;
    max-width: 350px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.loader-content {
    position: relative;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--haca-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.loader-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.loader-dots {
    display: inline-block;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

.loader-progress {
    width: 100%;
    height: 4px;
    background: #f3f3f3;
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--haca-primary), var(--haca-primary-light));
    animation: progressBar 2s ease-in-out infinite;
}

@keyframes progressBar {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Result Cards - Elegant Design */
.result-card,
.haca-zone-card,
.nearby-card,
.no-zone-card {
    position: absolute !important;
    bottom: 20px !important;
    left: 20px !important;
    width: 420px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 1000 !important;
    animation: slideInUp 0.4s ease;
    display: none;
    overflow: hidden;
}

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

.result-card .card-header,
.haca-zone-card .card-header,
.nearby-card .card-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, #FF6725 0%, #FF8A56 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card .card-body,
.haca-zone-card .card-body,
.nearby-card .card-body {
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 420px;
    background: white;
}

/* Property Header - Gradient Background */
.property-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.property-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #FF6725 0%, #FF8A56 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 103, 37, 0.25);
}

.property-icon.haca-icon {
    background: linear-gradient(135deg, #228B22 0%, #32CD32 100%);
    box-shadow: 0 4px 12px rgba(34, 139, 34, 0.25);
}

.property-title h5 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: -0.3px;
}

.property-title p {
    margin: 0;
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

/* Info Grid - Modern Card Grid Layout */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.info-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.info-item:hover {
    border-color: #ff672540;
    box-shadow: 0 4px 12px rgba(255, 103, 37, 0.08);
    transform: translateY(-2px);
}

.info-item-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #ff672510 0%, #ff672508 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ff6725;
    flex-shrink: 0;
}

.info-item-content {
    flex: 1;
    min-width: 0;
}

.info-item-label {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-item-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
}

/* Result Info Style - Elegant Design */
.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.result-info:hover {
    background: #f0f0f0;
    transform: translateX(2px);
}

.info-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #2d3748;
    font-size: 14px;
    text-align: right;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    word-break: break-word;
}

/* Regulation Sections */
.regulation-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.regulation-header {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.regulation-header.haca-info {
    color: #228B22;
}

.regulation-header.regulations {
    color: #dc3545;
}

.regulation-header.approval {
    color: #ffc107;
}

.regulation-header.property-buyer {
    color: #17a2b8;
}

.regulation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.regulation-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 13px;
    line-height: 1.6;
}

.regulation-list li:last-child {
    margin-bottom: 0;
}

.regulation-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    background: #ff6725;
    color: white;
    font-weight: bold;
    font-size: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0px;
}

.info-content {
    color: #374151;
    font-size: 13px;
    line-height: 1.6;
}

/* Close Button Style - Clean Design */
#closeResult,
#closeNearby,
#closeNoHaca {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: url(../dashboard/images/icon/pointer.svg), pointer !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

#closeResult:hover,
#closeNearby:hover,
#closeNoHaca:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Content Animation */
.land-details-section {
    animation: fadeInContent 0.5s ease;
}

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

/* Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 103, 37, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 103, 37, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 103, 37, 0);
    }
}

/* Custom Markers */
.custom-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.custom-marker.haca-zone {
    background: #228B22;
    animation: pulse 2s infinite;
}

.custom-marker.selected {
    background: var(--haca-primary);
    animation: pulse 1s infinite;
}

/* Scrollbar Styling */
.haca-search-results::-webkit-scrollbar,
.result-card .card-body::-webkit-scrollbar {
    width: 8px;
}

.haca-search-results::-webkit-scrollbar-track,
.result-card .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.haca-search-results::-webkit-scrollbar-thumb,
.result-card .card-body::-webkit-scrollbar-thumb {
    background: var(--haca-primary);
    border-radius: 10px;
}

.haca-search-results::-webkit-scrollbar-thumb:hover,
.result-card .card-body::-webkit-scrollbar-thumb:hover {
    background: var(--haca-primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    #map,
    .haca-map {
        height: 450px !important;
    }

    .result-card,
    .haca-zone-card,
    .nearby-card,
    .no-zone-card {
        width: calc(100% - 20px);
        left: 10px !important;
        right: 10px;
        bottom: 10px !important;
    }

    .map-legend,
    #mapLegend {
        bottom: 60px !important;
        left: 10px !important;
        font-size: 11px;
        width: 140px;
    }

    .survey-map-search-container {
        width: calc(100% - 80px);
        left: 10px;
    }

    .map-controls,
    .map-controls-container {
        top: 10px;
        right: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .map-controls,
    .location-button,
    #closeResult,
    #closeNearby,
    #closeNoHaca,
    .btn {
        display: none !important;
    }

    .result-card,
    .haca-zone-card {
        position: relative !important;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}
