/* rent.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;
}

body.dark-mode {
    background-color: #1e1e2f;
    color: #eee;
}
body.dark-mode .top-header,
body.dark-mode .rent-container,
body.dark-mode .bottom-nav-bar,
body.dark-mode .auth-modal-content,
body.dark-mode .modal-content,
body.dark-mode .sidebar,
body.dark-mode .rent-card {
    background-color: #2d2d3a;
    color: #eee;
    border-color: #444;
}
body.dark-mode .filter-select,
body.dark-mode .btn-outline,
body.dark-mode .auth-btn,
body.dark-mode .close-btn,
body.dark-mode .sidebar-action-btn,
body.dark-mode .auth-sidebar-btn {
    background-color: #3a3a4a;
    color: #eee;
    border-color: #555;
}
body.dark-mode .nav-item {
    color: #aaa;
}
body.dark-mode .nav-item.active {
    color: #1877f2;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-container:hover {
    opacity: 0.8;
}

.logo {
    font-size: clamp(24px, 6vw, 28px);
    color: #1877f2;
}

.site-title {
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    color: #1877f2;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #1877f2;
    color: white;
}

.btn-primary:hover {
    background-color: #166fe5;
}

.btn-outline {
    background-color: #f0f2f5;
    color: #65676b;
}

.btn-outline:hover {
    background-color: #e4e6eb;
}

#toggleSidebarBtn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #65676b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s;
}

#toggleSidebarBtn: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: 1.125rem;
    color: #1877f2;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    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: 0.9375rem;
}

.sidebar-menu a i {
    width: 20px;
    color: #1877f2;
    font-size: 1.125rem;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #f0f2f5;
}

.sidebar-actions {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
}

.sidebar-actions h4 {
    margin-bottom: 10px;
    color: #1877f2;
    font-size: 0.95rem;
}

.sidebar-action-btn {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    border: none;
    border-radius: 5px;
    background: #f0f2f5;
    color: #1c1e21;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.sidebar-action-btn:hover {
    background: #e4e6eb;
}

.auth-sidebar-buttons {
    padding: 16px 20px;
    border-top: 1px solid #dddfe2;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-sidebar-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    font-size: 0.9375rem;
    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;
}

/* المحتوى الرئيسي */
.rent-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1877f2;
    font-size: clamp(20px, 5vw, 28px);
}

/* شريط الفلاتر */
.rent-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    background: #f0f2f5;
    padding: 15px;
    border-radius: 8px;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #dddfe2;
    border-radius: 20px;
    background: white;
    font-size: 14px;
    color: #1c1e21;
    cursor: pointer;
    min-width: 180px;
    flex: 1;
}

.filter-select:focus {
    outline: none;
    border-color: #1877f2;
}

/* قائمة العقارات */
.rent-listings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rent-card {
    background: white;
    border: 1px solid #dddfe2;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.rent-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.rent-media {
    width: 100%;
    height: 300px;
    background: #000;
    position: relative;
}

.rent-media img,
.rent-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rent-media .swiper {
    height: 100%;
}

.rent-content {
    padding: 16px;
}

.rent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rent-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c1e21;
}

.rent-price {
    background: #e7f3ff;
    color: #1877f2;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
}

.rent-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.rent-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #65676b;
}

.rent-detail-item i {
    width: 16px;
    color: #1877f2;
}

.rent-detail-item a {
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
}

.rent-detail-item a:hover {
    text-decoration: underline;
}

.rent-description {
    background: #f0f2f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    color: #1c1e21;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.rent-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rent-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.rent-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.rent-action-btn.save {
    background: #f0f2f5;
    color: #e74c3c;
}

.rent-action-btn.save.saved {
    background: #e74c3c;
    color: white;
}

.rent-action-btn.delete {
    background: #e74c3c;
    color: white;
}

.rent-action-btn.delete:hover {
    background: #c0392b;
}

.rent-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* لا توجد نتائج */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #65676b;
}

.no-results i {
    font-size: 48px;
    color: #bec3c9;
    margin-bottom: 16px;
}

.no-results h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

/* الشريط السفلي */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    backdrop-filter: blur(20px);
    border-top: 1px solid #dddfe2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #65676b;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
    border-radius: 8px;
    flex: 1;
    max-width: 70px;
    height: 100%;
}

.nav-item:hover {
    color: #1877f2;
    background-color: #f0f2f5;
}

.nav-item.active {
    color: #1877f2;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e41e3f;
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-only {
    display: none;
}

.admin-only.visible {
    display: flex;
}

/* المودالات */
.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 {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1877f2;
}

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

.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: 5px;
    font-size: 14px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1877f2;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

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

/* مودال تأكيد الحذف */
.confirm-delete-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.confirm-delete-content h3 {
    margin-bottom: 15px;
    color: #e74c3c;
}

.confirm-delete-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.confirm-btn.delete {
    background: #e74c3c;
    color: white;
}

.confirm-btn.cancel {
    background: #f0f2f5;
    color: #65676b;
}

/* الإشعارات المنبثقة */
.notification {
    position: fixed;
    top: 100px;
    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-color: #e7f6ea; color: #0a7c2f; border: 1px solid #a8e6b9; }
.notification.error { background-color: #fde8e8; color: #c53030; border: 1px solid #fecaca; }
.notification.info { background-color: #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; }
}

/* عنصر التحميل */
.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;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .rent-container {
        margin: 10px;
        padding: 15px;
    }
    .rent-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-select {
        width: 100%;
    }
    .rent-details {
        grid-template-columns: 1fr;
    }
    .header-actions .btn span {
        display: none;
    }
}