/* Custom CSS for Areas Page */

/* Hero section styling */

/* Area card styling */
.service-area-item {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    height: 100%;
    border-radius: 0.75rem !important;
    overflow: hidden;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-area-item:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 35px rgba(13, 110, 253, 0.2) !important;
}

.service-area-item .p-4 {
    background-color: white;
    transition: all 0.4s ease;
    padding: 1.5rem !important;
    position: relative;
    z-index: 2;
}

.service-area-item:hover .p-4 {
    background-color: #f8f9fa;
}

.service-area-item .p-4 p {
    color: #6c757d;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

/* Map container styling */
.area-map-container {
    height: 220px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='38' viewBox='0 0 38 38'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:%230d6efd;opacity:0.2;%7D%3C/style%3E%3C/defs%3E%3Cpath class='a' d='M19,0A19,19,0,1,1,0,19,19,19,0,0,1,19,0Zm0,5.5A13.5,13.5,0,1,0,32.5,19,13.5,13.5,0,0,0,19,5.5Z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 40px;
}

.area-map-container:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, #d4a762, #0a58ca, #084298, #0a58ca, #d4a762);
    opacity: 0;
    transition: all 0.4s ease;
}

.service-area-item:hover .area-map-container:after {
    opacity: 1;
    height: 4px;
}

.area-map-iframe {
    height: 100%;
    width: 100%;
    border: none;
    transition: all 0.5s ease;
    position: relative;
    display: block;
    filter: grayscale(30%) brightness(1.05);
    transform: scale(1.01);
}

.service-area-item:hover .area-map-iframe {
    filter: grayscale(0%) brightness(1.05);
    transform: scale(1.05);
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 35, 61, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.4s ease;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through to the map */
}

.service-area-item:hover .map-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 35, 61, 0.8));
}

/* Add a clickable button to view on Google Maps */
.view-map-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #d4a762;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 11;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.service-area-item:hover .view-map-btn {
    opacity: 1;
    transform: translateY(0);
}

.view-map-btn:hover {
    background: #d4a762;
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.area-name {
    text-align: center;
    padding: 0;
    transition: all 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 35, 61, 0.9), transparent);
    padding-bottom: 15px;
    padding-top: 40px;
}

.service-area-item:hover .area-name {
    padding-bottom: 25px;
}

.area-name h4 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
}

.service-area-item:hover .area-name h4 {
    transform: translateY(-5px);
}

.area-name .badge {
    transition: all 0.4s ease;
    background-color: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.service-area-item:hover .area-name .badge {
    background-color: #d4a762 !important;
    transform: translateY(-3px);
}

/* Fallback map styling */
.fallback-map {
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.fallback-map i {
    color: #d4a762;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fallback-map h5 {
    color: #d4a762;
    margin-top: 10px;
    font-weight: 600;
}

.fallback-main-map {
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 5px;
}

.area-badge {
    transition: all 0.3s ease;
    cursor: pointer;
}

.area-badge:hover {
    background-color: #e9ecef !important;
    transform: translateY(-3px);
}

/* Main map styling */
.main-map-container {
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 5px;
}

/* Service radius visualization */
.radius-circle {
    border: 2px dashed rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    position: absolute;
}

.radius-25 {
    width: 150px;
    height: 150px;
    animation: pulse 2s infinite;
}

.radius-50 {
    width: 300px;
    height: 300px;
    animation: pulse 3s infinite;
}

.pulsating-circle {
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(var(--primary-rgb), 0.4);
    animation: pulse-dot 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(var(--primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
    }
}

/* Button styling for area cards */
.service-area-item .btn-outline-primary {
    border-width: 2px;
    font-weight: 600;
    transition: all 0.4s ease;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
}

.service-area-item .btn-primary {
    font-weight: 600;
    transition: all 0.4s ease;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.15);
}

.service-area-item:hover .btn-outline-primary {
    transform: translateY(-3px);
}

.service-area-item:hover .btn-primary {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.25);
}

.service-area-item .btn i {
    transition: all 0.3s ease;
}

.service-area-item:hover .btn i {
    transform: translateX(3px);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .area-map-container {
        height: 200px;
    }
    
    .service-area-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .area-map-container {
        height: 180px;
    }
    
    .radius-25 {
        width: 100px;
        height: 100px;
    }
    
    .radius-50 {
        width: 200px;
        height: 200px;
    }
    
    .area-name h4 {
        font-size: 1.25rem;
    }
    
    .view-map-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

@media (max-width: 576px) {
    .area-map-container {
        height: 160px;
    }
    
    .service-area-item .p-4 {
        padding: 1.25rem !important;
    }
    
    .service-area-item .btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}