:root {
 --icon-url-green: url('https://mawagaza.com/wp-content/uploads/2025/01/location_GREEN.png');
 --icon-url-yellow: url('https://mawagaza.com/wp-content/uploads/2025/01/location_YELLOW.png');
 --icon-url-red: url('https://mawagaza.com/wp-content/uploads/2025/01/location_RED.png');
 --icon-url-gray: url('https://mawagaza.com/wp-content/uploads/2025/01/location_GRAY.png');
 --icon-url-orange: url('https://mawagaza.com/wp-content/uploads/2025/01/location_ORANGE.png');
}

.property-filters {
 display: flex;
 flex-wrap: wrap;
 gap: 10px;
 margin-bottom: 20px;
}

.property-filters .filter-group {
 flex: 1 1 100px;
}

.property-filters .filter-group label {
 display: block;
 margin-bottom: 5px;
 font-weight: bold;
 color: #333;
}

.property-filters .filter-group select {
 width: 100%;
 padding: 8px;
 border: 1px solid #ddd;
 border-radius: 4px;
 background-color: #fff;
 font-size: 14px;
}

.property-filters .filter-group select:focus {
 outline: none;
 border-color: #007cba;
 box-shadow: 0 0 0 1px #007cba;
}

/* Checkbox styling for date filters */
.property-filters .filter-group label input[type="checkbox"] {
 margin-right: 8px;
 margin-left: 0;
 vertical-align: middle;
}

.property-filters .filter-group label:has(input[type="checkbox"]) {
 display: flex;
 align-items: center;
 cursor: pointer;
 padding: 8px;
 border: 1px solid #ddd;
 border-radius: 4px;
 background-color: #fff;
 transition: background-color 0.2s ease;
}

.property-filters .filter-group label:has(input[type="checkbox"]):hover {
 background-color: #f8f9fa;
}

@media (min-width: 768px) {
 .property-filters .filter-group {
 flex: 0 0 auto;
 }
}

#property-map,
#property-map-single,
.property-map-shortcode {
 width: 100%;
 height: 500px;/* Change this value to your desired height */
 border: 1px solid #ddd;
 border-radius: 4px;
 position: relative;
 z-index: 1;
}

/* Ensure Leaflet containers display properly */
.leaflet-container {
 height: 500px;
 width: 100%;
}

.property-single {
 padding: 20px;
 background-color: #fff;
 border-radius: 8px;
 box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 margin-bottom: 20px;
}

.property-header {
 text-align: center;
 margin-bottom: 20px;
}

.property-title {
 font-size: 2em;
 margin-bottom: 10px;
}

.property-image-full img,
.property-single .property-image img {
 width: 100%;
 height: auto;
 max-height: 250px;
 object-fit: cover;
 margin-bottom: 20px;
 border-radius: 8px;
}

.property-single .property-details {
 margin-bottom: 20px;
}

.property-details h2,
.property-description h2,
.property-map h2 {
 font-size: 1.5em;
 margin-bottom: 10px;
}

.property-details ul {
 list-style: none;
 padding: 0;
}

.property-details li,
.property-single .property-details p {
 margin-bottom: 5px;
}

.property-description,
.property-map {
 margin-bottom: 20px;
}

#property-edit-form {
 margin-top: 20px;
 grid-template-columns: 1fr 2fr;
 gap: 20px;
 background-color: #f9f9f9;
 padding: 20px;
 border-radius: 8px;
 box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#property-edit-form h3 {
 grid-column: span 2;
 margin-bottom: 20px;
 font-size: 1.8em;
 color: #333;
}

#property-edit-form label {
 align-self: center;
 font-weight: bold;
 color: #555;
}

#property-edit-form select,
#property-edit-form input {
 width: 100%;
 padding: 10px;
 border: 1px solid #ccc;
 border-radius: 4px;
 font-size: 1em;
 color: #333;
}

#property-edit-message {
 grid-column: span 2;
 margin-top: 10px;
 color: green;
 font-size: 1em;
}

@media (min-width: 768px) {
 .property-single {
 display: flex;
 flex-wrap: wrap;
 gap: 20px;
 }

 .property-header,
 .property-details,
 .property-description,
 .property-map,
 .property-edit-form {
 flex: 1 1 100%;
 }

 .property-single .property-image {
 flex: 1 1 40%;
 }

 .property-single .property-details,
 .property-single .property-description {
 flex: 1 1 55%;
 }

 #property-edit-form {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 20px;
 }

 #property-edit-form label {
 grid-column: span 1;
 }

 #property-edit-form select,
 #property-edit-form input {
 grid-column: span 1;
 }

 #property-edit-form button {
 grid-column: span 2;
 justify-self: end;
 }
}

/* RTL Support */
html[lang="ar"] .property-filters,
html[lang="ar"] .property-single,
html[lang="ar"] .property-header,
html[lang="ar"] .property-details,
html[lang="ar"] .property-description,
html[lang="ar"] .property-map,
html[lang="ar"] .property-edit-form {
 direction: rtl;
 text-align: right;
}

/* Professional,unified button style for all plugin buttons */
.pmp-btn,
#filter-apply,
#property-edit-form button,
.view-property-button,
.property-map a.pmp-btn {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 padding: 12px 28px;
 background: #198454;
 color: #fff;
 border: none;
 border-radius: 6px;
 font-weight: 600;
 font-size: 1.08em;
 letter-spacing: 0.02em;
 box-shadow: 0 2px 8px rgba(25,132,84,0.10),0 1.5px 4px rgba(25,132,84,0.13);
 cursor: pointer;
 transition: background 0.18s,box-shadow 0.18s,transform 0.12s;
 margin-top: 10px;
 outline: none;
 min-width: 120px;
 min-height: 44px;
 text-decoration: none;
 text-align: center;
 user-select: none;
 height: 44px;/* Ensure all buttons have the same height */
 line-height: 1.2;
}

.pmp-btn:active,
#filter-apply:active,
#property-edit-form button:active,
.view-property-button:active,
.property-map a.pmp-btn:active {
 background: #156b44;
 transform: scale(0.98);
}

.pmp-btn:hover,
#filter-apply:hover,
#property-edit-form button:hover,
.view-property-button:hover,
.pmp-btn:focus,
#filter-apply:focus,
#property-edit-form button:focus,
.view-property-button:focus,
.property-map a.pmp-btn:hover,
.property-map a.pmp-btn:focus {
 background: #156b44;
 box-shadow: 0 4px 16px rgba(25,132,84,0.13),0 2px 8px rgba(25,132,84,0.13);
 color: #fff;
 outline: none;
}

/* Center buttons on property page (all screens) */
.property-single .pmp-btn,
.property-single #filter-apply,
.property-single #property-edit-form button,
.property-single .view-property-button,
.property-single .property-map a.pmp-btn {
 display: flex;
 justify-content: center;
 align-items: center;
 margin-left: auto;
 margin-right: auto;
}

@media (max-width: 600px) {
 .property-single .pmp-btn,
 .property-single #filter-apply,
 .property-single #property-edit-form button,
 .property-single .view-property-button,
 .property-single .property-map a.pmp-btn {
 display: flex !important;
 justify-content: center !important;
 align-items: center !important;
 width: 100% !important;
 min-width: 0 !important;
 max-width: 100% !important;
 margin-left: 0 !important;
 margin-right: 0 !important;
 text-align: center !important;
 }
}

.leaflet-container a {
 color: #fff;
}

.comment-image img {
 display: block;
 margin-top: 10px;
 max-width: 200px;
 max-height: 200px;
 border-radius: 6px;
 box-shadow: 0 2px 8px rgba(25,132,84,0.08);
}

#pmp-add-success-modal {
 display: none;
 position: fixed;
 top: 0;left: 0;
 width: 100vw;height: 100vh;
 background: rgba(0,0,0,0.5);
 z-index: 9999;
 align-items: center;
 justify-content: center;
}

#pmp-add-success-modal-content {
 background: #fff;
 padding: 30px 20px;
 border-radius: 8px;
 max-width: 90vw;
 width: 350px;
 text-align: center;
 box-shadow: 0 2px 16px rgba(0,0,0,0.2);
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translate(-50%,-50%);
}

@media (max-width: 480px) {
 #pmp-add-success-modal-content {
 width: 95vw;
 padding: 18px 6vw;
 font-size: 1em;
 }
 #pmp-add-success-modal .pmp-btn,
 #pmp-view-property-btn {
 min-width: 90px;
 font-size: 1em;
 padding: 10px 0;
 }
}

/* GPS Location Button Styles */
.leaflet-control-gps {
 background: white;
 border-radius: 4px;
 box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.leaflet-control-gps a {
 display: flex;
 align-items: center;
 justify-content: center;
 width: 30px;
 height: 30px;
 background: white;
 text-decoration: none;
 color: #333;
 font-size: 16px;
 border-radius: 4px;
 transition: all 0.2s ease;
}

.leaflet-control-gps a:hover {
 background: #f0f0f0;
 color: #007cba;
 transform: scale(1.1);
}

.leaflet-control-gps a:active {
 transform: scale(0.95);
}

/* User location marker animation */
@keyframes pulse {
 0% {
 box-shadow: 0 0 0 0 rgba(0,124,186,0.7);
 }
 70% {
 box-shadow: 0 0 0 10px rgba(0,124,186,0);
 }
 100% {
 box-shadow: 0 0 0 0 rgba(0,124,186,0);
 }
}

.user-location-marker {
 animation: pulse 2s infinite;
}

/* Leaflet Popup Styles for Property Information */
.leaflet-popup-content-wrapper {
 border-radius: 6px;
 box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
 margin: 0;
 padding: 12px;
 line-height: 1.3;
 min-width: 260px;
 max-width: 300px;
 max-height: 350px;
 overflow-y: auto;
 font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}

.property-popup-title {
 font-size: 14px;
 font-weight: 700;
 color: #2c3e50;
 margin-bottom: 8px;
 padding-bottom: 4px;
 border-bottom: 2px solid #3498db;
 text-align: center;
}

.property-popup-basic-info {
 margin-bottom: 12px;
}

.basic-info-item {
 display: flex;
 align-items: center;
 padding: 4px 0;
 font-size: 11px;
 color: #555;
 border-bottom: 1px solid #f0f0f0;
}

.basic-info-item:last-child {
 border-bottom: none;
}

.property-popup-services {
 display: flex;
 flex-direction: column;
 gap: 4px;
 margin-bottom: 12px;
}

@media (max-width: 320px) {
 .property-popup-services {
 gap: 3px;
 }
}

.service-item {
 display: flex;
 align-items: center;
 padding: 6px 8px;
 background-color: #ffffff;
 border: 1px solid #e9ecef;
 border-radius: 4px;
 font-size: 11px;
 line-height: 1.3;
 transition: all 0.2s ease;
 width: 100%;
 box-sizing: border-box;
 min-height: 32px;
}

.service-item:hover {
 transform: translateY(-1px);
 box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.service-item .emoji {
 font-size: 14px;
 margin-left: 8px;
 flex-shrink: 0;
 width: 16px;
 text-align: center;
}

.service-content {
 display: flex;
 align-items: center;
 flex: 1;
 min-width: 0;
 gap: 6px;
}

.service-item .service-label {
 font-weight: 600;
 color: #495057;
 font-size: 11px;
 white-space: nowrap;
 min-width: fit-content;
}

.service-item .service-value {
 font-weight: 500;
 color: #212529;
 font-size: 11px;
 flex: 1;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.service-item.good {
 border-color: #28a745;
 background: linear-gradient(135deg,#f8fff8 0%,#e8f5e8 100%);
}

.service-item.good .service-value {
 color: #155724;
}

.service-item.fair {
 border-color: #ffc107;
 background: linear-gradient(135deg,#fffef8 0%,#fff8e1 100%);
}

.service-item.fair .service-value {
 color: #856404;
}

.service-item.poor {
 border-color: #dc3545;
 background: linear-gradient(135deg,#fff8f8 0%,#f8e8e8 100%);
}

.service-item.poor .service-value {
 color: #721c24;
}

.property-popup-button {
 text-align: center;
 margin-top: 8px;
 padding-top: 6px;
 border-top: 1px solid #e9ecef;
}

.property-popup-button .view-property-button {
 margin: 0;
 font-size: 1.08em;
 font-weight: 600;
 padding: 6px 12px;
 min-width: auto;
 display: inline-block;
 border-radius: 6px;
 text-decoration: none;
 background: #198454;
 color: #fff;
 border: none;
 transition: all 0.2s ease;
}

.property-popup-button .view-property-button:hover {
 background: #156b44;
 transform: translateY(-1px);
 box-shadow: 0 2px 4px rgba(25,132,84,0.3);
}

/* Hide logged-in-as message in comment form */
.logged-in-as {
 display: none !important;
}

.comment-form .logged-in-as {
 display: none !important;
}

p.logged-in-as {
 display: none !important;
}

/* Location Button Styles */
.leaflet-control-custom {
 background: white !important;
 border: 2px solid rgba(0,0,0,0.2) !important;
 border-radius: 4px !important;
 box-shadow: 0 1px 5px rgba(0,0,0,0.4) !important;
 transition: all 0.2s ease !important;
}

.leaflet-control-custom:hover {
 background: #f4f4f4 !important;
 border-color: rgba(0,0,0,0.4) !important;
 box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}

.leaflet-control-custom:active {
 background: #e8e8e8 !important;
 transform: translateY(1px) !important;
}

/* Ensure location controls don't interfere with map layers */
.leaflet-top.leaflet-right {
 z-index: 1000 !important;
}

/* User location marker styling */
.user-location-marker {
 background: transparent !important;
 border: none !important;
}

.user-location-marker div {
 position: relative;
 animation: pulse 2s infinite;
}

@keyframes pulse {
 0% {
 box-shadow: 0 0 0 0 rgba(66,133,244,0.7);
 }
 70% {
 box-shadow: 0 0 0 10px rgba(66,133,244,0);
 }
 100% {
 box-shadow: 0 0 0 0 rgba(66,133,244,0);
 }
}

/* User location marker popup */
.leaflet-popup-content {
 direction: rtl;
 text-align: right;
}

/* Ensure user location elements have proper z-index */
.leaflet-marker-pane .leaflet-marker-icon[title*="موقعك"] {
 z-index: 1000 !important;
}
