/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    direction: rtl;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

nav ul li a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1560518883-ce09059eeffa?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80') center/cover;
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(102,126,234,0.3), rgba(118,75,162,0.3));
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-bar {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.search-bar input {
    padding: 15px;
    font-size: 1rem;
    border: none;
    border-radius: 25px 0 0 25px;
    width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    transform: scale(1.02);
}

.search-bar button {
    padding: 15px 30px;
    font-size: 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-bar button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Listings Section */
.listings {
    padding: 50px 0;
    background-color: white;
}

.listings h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2rem;
    position: relative;
}

.listings h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.filters select {
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filters select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102,126,234,0.2);
}

.property-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.property-card {
    background-color: white;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.6s ease-out both;
}

.property-card:nth-child(1) { animation-delay: 0.1s; }
.property-card:nth-child(2) { animation-delay: 0.2s; }
.property-card:nth-child(3) { animation-delay: 0.3s; }
.property-card:nth-child(4) { animation-delay: 0.4s; }
.property-card:nth-child(5) { animation-delay: 0.5s; }
.property-card:nth-child(6) { animation-delay: 0.6s; }

.property-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.property-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover img {
    transform: scale(1.1);
}

.property-info {
    padding: 20px;
}

.property-info h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.property-info p {
    margin-bottom: 8px;
    color: #666;
    font-size: 0.9rem;
}

.price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 15px;
}

.property-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102,126,234,0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245,87,108,0.3);
}

/* About Section */
.about {
    padding: 50px 0;
    background-color: #f8f9fa;
}

.about h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.about p {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: #666;
}

/* Contact Section */
.contact {
    padding: 50px 0;
    background-color: white;
}

.contact h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

#contact-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

#contact-form input,
#contact-form textarea {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

#contact-form textarea {
    height: 100px;
    resize: vertical;
}

#contact-form button {
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#contact-form button:hover {
    background-color: #2980b9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s;
}

.close:hover {
    color: #667eea;
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-main-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #667eea;
    transform: scale(1.1);
}

.modal-details h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-details p {
    margin-bottom: 10px;
    color: #666;
}

.modal-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-thumbnails {
        flex-wrap: wrap;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin-top: 10px;
    }

    nav ul li {
        margin-left: 10px;
        margin-right: 10px;
    }

    .search-bar {
        flex-direction: column;
        align-items: center;
    }

    .search-bar input {
        width: 100%;
        max-width: 300px;
        border-radius: 5px;
        margin-bottom: 10px;
    }

    .search-bar button {
        border-radius: 5px;
    }

    .filters {
        flex-direction: column;
        align-items: center;
    }

    .property-list {
        grid-template-columns: 1fr;
    }
}