/* =========================================
   Reset & Base Styles
========================================= */
@import url('https://v1.fontapi.ir/css/Vazir');

body, html {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
    font-family: 'Vazir', Tahoma, sans-serif;
    background-color: #e5e9f0;
}

.map-container {
    width: 100%; height: 100vh; position: absolute; top: 0; left: 0; z-index: 1;
}

/* =========================================
   Glassmorphism (افکت شیشه‌ای حرفه‌ای)
========================================= */
.glass-widget, .glass-btn, .glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: absolute;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   Floating Triggers (دکمه‌های باز کردن پنل)
========================================= */
.float-right { top: 25px; right: 25px; border-radius: 50%; width: 55px; height: 55px; cursor: pointer; font-size: 22px; color: #2c3e50; border: none;}
.float-left { top: 25px; left: 25px; border-radius: 50%; width: 55px; height: 55px; cursor: pointer; font-size: 22px; color: #2c3e50; border: none;}
.float-right:hover, .float-left:hover { background: #fff; transform: scale(1.1); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); }

/* =========================================
   Panels (پنل‌های کشویی لایه‌ها و ابزارها)
========================================= */
.glass-panel {
    top: 25px; bottom: 25px; width: 340px; border-radius: 20px; 
    display: flex; flex-direction: column; overflow: hidden;
}
.panel-right { right: -400px; }
.panel-left { left: -400px; }
.panel-right.active { right: 25px; }
.panel-left.active { left: 25px; }

.panel-header {
    background: rgba(44, 62, 80, 0.05);
    padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.panel-header h3 { margin: 0; font-size: 16px; color: #2c3e50; }
.close-btn { background: none; border: none; font-size: 18px; color: #e74c3c; cursor: pointer; transition: 0.2s;}
.close-btn:hover { transform: rotate(90deg); }

.panel-content { padding: 20px; overflow-y: auto; }

/* =========================================
   Layers Switch (دکمه‌های خاموش/روشن مدرن)
========================================= */
.layer-group { margin-bottom: 25px; }
.layer-group h4 { margin: 0 0 15px 0; font-size: 13px; color: #7f8c8d; border-bottom: 1px dashed #bdc3c7; padding-bottom: 8px;}

.layer-switch { display: flex; align-items: center; margin-bottom: 15px; cursor: pointer; font-size: 14px; color: #34495e;}
.layer-switch input { display: none; }
.slider {
    position: relative; width: 44px; height: 24px; background-color: #ccc; 
    border-radius: 34px; margin-left: 12px; transition: .4s;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; 
    background-color: white; border-radius: 50%; transition: .4s;
}
.layer-switch input:checked + .slider { background-color: #27ae60; }
.layer-switch input:checked + .slider:before { transform: translateX(20px); }

/* =========================================
   Tools Buttons (دکمه‌های ابزار)
========================================= */
.tool-btn {
    width: 100%; padding: 12px 15px; margin-bottom: 10px; border: none;
    border-radius: 10px; background: #f8f9fa; color: #2c3e50; font-family: inherit;
    font-size: 14px; text-align: right; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.tool-btn i { font-size: 16px; width: 25px; text-align: center; color: #3498db; }
.tool-btn:hover { background: #e0e6ed; transform: translateY(-2px); }
.btn-primary { background: #3498db; color: white; }
.btn-primary i { color: white; }
.btn-primary:hover { background: #2980b9; }
.glass-divider { border: 0; height: 1px; background: rgba(0,0,0,0.1); margin: 20px 0; }

/* =========================================
   Profile & Logout Widget (پروفایل و خروج)
========================================= */
.top-left { 
    top: 25px; left: 100px; padding: 8px 15px; border-radius: 50px; 
    display: flex; align-items: center; gap: 15px; background: rgba(255, 255, 255, 0.95);
}
.user-info { display: flex; align-items: center; gap: 8px; color: #2c3e50; font-size: 14px;}
.user-badge { background: #f39c12; color: white; padding: 3px 8px; border-radius: 12px; font-size: 11px;}

.btn-logout { 
    background: #e74c3c; color: white; border-radius: 50%; width: 35px; height: 35px; 
    display: flex; justify-content: center; align-items: center; text-decoration: none; 
    transition: 0.3s; box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}
.btn-logout:hover { background: #c0392b; transform: scale(1.1) rotate(15deg); }

/* =========================================
   Basemap Widget (نقشه‌های پایه)
========================================= */
.bottom-left { bottom: 25px; left: 25px; padding: 8px; border-radius: 15px; display: flex; gap: 8px; }
.basemap-btn {
    background: transparent; border: none; font-size: 20px; color: #7f8c8d;
    cursor: pointer; padding: 8px 12px; border-radius: 10px; transition: 0.3s;
}
.basemap-btn:hover, .basemap-btn.active { background: #3498db; color: white; }

/* استایل برچسب‌های ابزار اندازه‌گیری */
.ol-tooltip {
    position: relative;
    background: rgba(44, 62, 80, 0.9);
    border-radius: 6px;
    color: white;
    padding: 6px 10px;
    opacity: 0.9;
    white-space: nowrap;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    direction: ltr; /* برای نمایش درست اعداد و واحدها */
}
.ol-tooltip-measure {
    opacity: 1;
    font-weight: bold;
}
.ol-tooltip-static {
    background-color: #e74c3c;
    border: 1px solid white;
}