/* shared.css - الأنماط المشتركة لجميع الصفحات */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    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 {
    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;
    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;
    font-size: 16px;
}

.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: 450px;
    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);
}

/* رسائل الخطأ */
.error-message {
    color: #e41e3f;
    margin-bottom: 15px;
    display: none;
    text-align: center;
    font-size: 14px;
    background: #fde8e8;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #fecaca;
}

/* أزرار عامة */
.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%;
}

/* الإشعارات المنبثقة */
.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;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 60px;
    }
    .bottom-nav {
        height: 60px;
    }
    .nav-icon {
        font-size: 20px;
    }
    .nav-text {
        font-size: 10px;
    }
}