/* shared.css - الأنماط المشتركة لجميع الصفحات مع تحسينات المودال المتعدد الخطوات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    line-height: 1.34;
    min-height: 100vh;
    padding-bottom: 70px;
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
}

body.dark-mode {
    background-color: #1e1e2f;
    color: #eee;
}
body.dark-mode .top-header,
body.dark-mode .sidebar,
body.dark-mode .bottom-nav,
body.dark-mode .modal-content,
body.dark-mode .auth-modal-content,
body.dark-mode .account-modal-content,
body.dark-mode .admin-panel-content,
body.dark-mode .pending-properties-content,
body.dark-mode .contact-content,
body.dark-mode .saved-content,
body.dark-mode .add-property-content,
body.dark-mode .property-card,
body.dark-mode .estimate-content,
body.dark-mode .filters-panel,
body.dark-mode .request-buttons,
body.dark-mode .agents-section,
body.dark-mode .featured-section,
body.dark-mode .stat-card,
body.dark-mode .listing-card,
body.dark-mode .filters-container,
body.dark-mode .chart-container,
body.dark-mode .requests-list .request-card,
body.dark-mode .post-card,
body.dark-mode .request-item,
body.dark-mode #agencyInfo {
    background-color: #2d2d3a;
    color: #eee;
    border-color: #444;
}
body.dark-mode .option-btn,
body.dark-mode .filter-select,
body.dark-mode .add-property-btn,
body.dark-mode .icon-btn,
body.dark-mode .auth-btn,
body.dark-mode .account-btn,
body.dark-mode .close-btn,
body.dark-mode .action-btn,
body.dark-mode .btn-outline,
body.dark-mode .sidebar-action-btn,
body.dark-mode .step {
    background-color: #3a3a4a;
    color: #eee;
    border-color: #555;
}
body.dark-mode .nav-item {
    color: #aaa;
}
body.dark-mode .nav-item.active {
    color: #1877f2;
}
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #3a3a4a;
    color: #eee;
    border-color: #555;
}

/* الشريط العلوي */
.top-header {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #dddfe2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.logo-container:hover {
    opacity: 0.8;
}
.logo {
    color: #1877f2;
    font-size: 24px;
}
.site-title, .app-name {
    font-size: 18px;
    font-weight: bold;
    color: #1877f2;
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 16px;
}
.search-box {
    width: 100%;
    padding: 8px 15px;
    border: none;
    background: #f0f2f5;
    border-radius: 50px;
    font-size: 14px;
    outline: none;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #65676b;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}
.icon-btn:hover {
    background-color: #f0f2f5;
    color: #1877f2;
}

/* القائمة الجانبية */
.sidebar {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: #fff;
    border-left: 1px solid #dddfe2;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.sidebar.open {
    transform: translateX(0);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #dddfe2;
}
.sidebar-header h3 {
    font-size: 18px;
    color: #1877f2;
}
.sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #65676b;
}
.sidebar-menu {
    list-style: none;
    padding: 16px 0;
}
.sidebar-menu li {
    margin-bottom: 4px;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #1c1e21;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 15px;
}
.sidebar-menu a i {
    width: 20px;
    color: #1877f2;
    font-size: 18px;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f0f2f5;
}
.sidebar-actions {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
    margin-top: 10px;
}
.sidebar-actions h4 {
    font-size: 16px;
    color: #1877f2;
    margin-bottom: 12px;
}
.sidebar-action-btn {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    background: #f0f2f5;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #1c1e21;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}
.sidebar-action-btn i {
    color: #1877f2;
    width: 20px;
}
.sidebar-action-btn:hover {
    background: #e4e6eb;
    transform: translateX(-2px);
}
.auth-sidebar-buttons {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-sidebar-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    width: 100%;
}
.auth-sidebar-btn.login {
    background: #1877f2;
    color: white;
}
.auth-sidebar-btn.register {
    background: #42b72a;
    color: white;
}
.auth-sidebar-btn.logout {
    background: #e74c3c;
    color: white;
}
.auth-sidebar-btn.admin {
    background: #9b59b6;
    color: white;
}

/* الشريط السفلي */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background: white;
    border-top: 1px solid #dddfe2;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #65676b;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
    flex: 1;
    max-width: 70px;
}
.nav-item.active {
    color: #1877f2;
    background: rgba(24, 119, 242, 0.1);
}
.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}
.nav-text {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.notification-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: #e74c3c;
    color: white;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* النماذج والحقول */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1c1e21;
    font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1877f2;
}

/* المودالات العامة */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content,
.auth-modal-content,
.account-modal-content,
.admin-panel-content,
.pending-properties-content,
.contact-content,
.saved-content,
.add-property-content,
.property-card,
.estimate-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: relative;
}
.modal-title {
    font-size: 20px;
    color: #1877f2;
    margin-bottom: 20px;
    text-align: center;
}
.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.1);
    color: #65676b;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.close-btn:hover {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    transform: rotate(90deg);
}

/* مودال إضافة العقار متعدد الخطوات */
.step-modal {
    max-width: 700px !important;
    width: 95% !important;
    padding: 0 !important;
    overflow: hidden !important;
}
.step-header {
    display: flex;
    background: #f0f2f5;
    border-bottom: 1px solid #dddfe2;
    padding: 0;
}
.step {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    background: #f0f2f5;
    color: #65676b;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}
.step.active {
    background: #fff;
    color: #1877f2;
    border-bottom: 3px solid #1877f2;
}
.step.completed {
    color: #00a400;
}
.step .step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    margin-left: 8px;
    font-size: 12px;
}
.step.active .step-number {
    background: #1877f2;
}
.step.completed .step-number {
    background: #00a400;
}
.step-content {
    padding: 20px;
    max-height: 65vh;
    overflow-y: auto;
}
.step-buttons {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #dddfe2;
    background: #f9f9f9;
}
.step-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}
.btn-next {
    background: #1877f2;
    color: white;
}
.btn-prev {
    background: #e4e6eb;
    color: #65676b;
}
.btn-submit {
    background: #00a400;
    color: white;
}
.dynamic-field {
    margin-bottom: 15px;
}
.dynamic-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}
.property-type-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}
.type-option {
    flex: 1;
    min-width: 100px;
    padding: 15px;
    background: #f0f2f5;
    border: 2px solid #dddfe2;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}
.type-option i {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}
.type-option.active {
    border-color: #1877f2;
    background: #e7f3ff;
    color: #1877f2;
}
.media-options {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.media-option {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: #f5f5f5;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}
.media-option:hover {
    background: #e9e9e9;
}
.media-option.active {
    border-color: #1877f2;
    background: #e7f3ff;
}
.media-input-group {
    display: none;
}
.media-input-group.active {
    display: block;
}
.multiple-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid #ddd;
    position: relative;
}
.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-preview-item .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255,0,0,0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}
.file-preview {
    margin-top: 10px;
    display: none;
}
.file-preview video {
    width: 100%;
    max-height: 150px;
}
.preview-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}
.preview-media {
    max-height: 200px;
    overflow: hidden;
    background: #000;
}
.preview-media img, .preview-media video {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}
.preview-details {
    padding: 15px;
}
.preview-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.preview-label {
    font-weight: 600;
    color: #65676b;
}
#mapLocationSelection {
    height: 300px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}
.location-instruction {
    text-align: center;
    color: #1877f2;
    margin-top: 10px;
    font-size: 14px;
}

/* أزرار عامة */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-primary {
    background: #1877f2;
    color: white;
}
.btn-primary:hover {
    background: #166fe5;
}
.btn-success {
    background: #00a400;
    color: white;
}
.btn-success:hover {
    background: #009900;
}
.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-outline {
    background: #f0f2f5;
    color: #65676b;
    border: 1px solid #dddfe2;
}
.btn-block {
    width: 100%;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* الإشعارات المنبثقة */
.notification {
    position: fixed;
    top: 80px;
    right: 50%;
    transform: translateX(50%);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease;
}
.notification.success { background: #e7f6ea; color: #0a7c2f; border: 1px solid #a8e6b9; }
.notification.error { background: #fde8e8; color: #c53030; border: 1px solid #fecaca; }
.notification.info { background: #e7f3ff; color: #1877f2; border: 1px solid #bbdfff; }
@keyframes slideDown {
    from { transform: translateX(50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(50%) translateY(0); opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateX(50%) translateY(0); opacity: 1; }
    to { transform: translateX(50%) translateY(-20px); opacity: 0; }
}

/* عناصر التحميل */
.loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    z-index: 1002;
    display: none;
    text-align: center;
}

/* فئة المسؤول المخفية */
.admin-only {
    display: none;
}
.admin-only.visible {
    display: block;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .header-search { display: none; }
    .top-header { padding: 0 8px; }
    .logo { font-size: 22px; }
    .site-title, .app-name { font-size: 16px; }
    .sidebar { width: 260px; }
    .step-modal { max-width: 95% !important; }
    .step { font-size: 12px; padding: 10px 5px; }
    .step .step-number { width: 20px; height: 20px; line-height: 20px; font-size: 10px; }
    .property-type-options { flex-direction: column; }
    .type-option { min-width: auto; }
}
@media (max-width: 480px) {
    body { padding-bottom: 60px; }
    .bottom-nav { height: 60px; }
    .nav-icon { font-size: 20px; }
    .nav-text { font-size: 10px; }
}