/* Map Page Specific Styles */
body.pw-calculate-area .entry-title,
body.pw-calculate-area .page-title,
body.pw-calculate-area .wp-block-post-title {
    display: none !important;
}

.map-container {
    display: flex;
    min-height: 100vh;
    height: auto;
    background: #0a0a0a;
}

.map-sidebar {
    width: 400px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 32px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.map-content {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.map-header {
    margin-bottom: 30px;
}

body.pw-calculate-area .map-header h1,
.map-header h1 {
    font-size: 28px;
    color: #ffffff !important;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.map-header h1::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #9AC72C, transparent);
    opacity: 0.9;
}

.map-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.5;
}

.area-info {
    background: rgba(154, 199, 44, 0.1);
    border: 1px solid rgba(154, 199, 44, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.area-value {
    font-size: 32px;
    font-weight: bold;
    color: #9AC72C;
    margin-bottom: 5px;
}

.area-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

body.pw-calculate-area .instructions h3,
.instructions h3 {
    color: #ffffff !important;
    margin-bottom: 15px;
    font-size: 18px;
}

.instructions ol {
    color: rgba(255, 255, 255, 0.8);
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    line-height: 1.4;
}

.map-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(26, 26, 26, 0), rgba(26, 26, 26, 0.85) 22%, rgba(26, 26, 26, 1));
    backdrop-filter: blur(10px);
}

.btn-map {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-draw {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    color: white;
}

.btn-draw:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.btn-draw.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45A049 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.btn-clear {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-calculate {
    background: linear-gradient(135deg, #9AC72C 0%, #7FA024 100%);
    color: white;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(154, 199, 44, 0.3);
}

.btn-back {
    background: transparent;
    color: #9AC72C;
    border: 1px solid #9AC72C;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #9AC72C;
    color: white;
}

.map-type-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-type-toggle button {
    padding: 8px 16px;
    border: none;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-type-toggle button:first-child {
    border-radius: 8px 0 0 8px;
}

.map-type-toggle button:last-child {
    border-radius: 0 8px 8px 0;
}

.map-type-toggle button.active {
    background: #9AC72C;
    color: white;
}

.leaflet-container {
    background: #0a0a0a;
}

.leaflet-draw-toolbar a {
    background-color: #2d2d2d !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #9AC72C !important;
}

.design-court-section {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(154, 199, 44, 0.1) 0%, rgba(127, 160, 36, 0.1) 100%);
    border: 1px solid rgba(154, 199, 44, 0.3);
    border-radius: 12px;
    text-align: center;
    animation: slideUp 0.5s ease;
}

body.pw-calculate-area .design-court-content h3,
.design-court-content h3 {
    color: #ffffff !important;
    margin-bottom: 10px;
    font-size: 20px;
}

.design-court-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.4;
}

.btn-design-court {
    background: linear-gradient(135deg, #9AC72C 0%, #7FA024 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px rgba(154, 199, 44, 0.3);
}

.btn-design-court:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(154, 199, 44, 0.4);
}

.btn-icon {
    font-size: 20px;
}

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

/* Responsive layout */
@media (max-width: 1024px) {
    .map-sidebar {
        width: 360px;
        padding: 26px;
    }
}

@media (max-width: 900px) {
    .map-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .map-sidebar {
        width: 100%;
        max-height: none;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .map-content {
        height: 65vh;
    }

    #map {
        height: 65vh;
    }

    .map-type-toggle {
        top: 12px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .map-sidebar {
        padding: 18px;
    }

    .map-header h1 {
        font-size: 22px;
    }

    .map-header p {
        font-size: 14px;
    }

    .map-controls {
        gap: 8px;
    }

    .btn-map {
        padding: 12px 14px;
        font-size: 12px;
    }
}

.map-search-container {
    position: absolute;
    top: 20px;
    left: 80px;
    z-index: 1000;
    width: 300px;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 14px;
    background: white;
    color: #333;
    padding-left: 20px;
}

.search-input::placeholder {
    color: #666;
}

.search-btn {
    padding: 12px 16px;
    border: none;
    background: #9AC72C;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.search-btn:hover {
    background: #7FA024;
}

.search-icon {
    font-size: 16px;
}

.search-results {
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: #f5f5f5;
}

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

.search-result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.search-result-address {
    font-size: 12px;
    color: #666;
}
