/* ================= ROOT COLORS ================= */
:root {
    --primary-green: #2ecc71;
    --dark-green: #27ae60;
    --light-green: #a8e6cf;
    --white: #ffffff;
    --light-gray: #f9f9f9;
    --text-dark: #333;
    --text-light: #777;
    --shadow: 0 10px 25px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px rgba(46, 204, 113, 0.15);
}

/* ================= GLOBAL ================= */
body {
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--light-green) 100%);
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    animation: fadeInBody 0.5s ease-in;
    
}

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

/* ================= SECTION ================= */
.housing-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    color: var(--dark-green);
    margin-bottom: 40px;
    font-weight: 800;
    font-size: 28px;
    position: relative;
    animation: fadeInTitle 0.6s ease-out;
}

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

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
    margin: 10px auto 0;
    border-radius: 2px;
    animation: growWidth 0.8s ease-out 0.3s both;
}

@keyframes growWidth {
    from { width: 0; }
    to { width: 80px; }
}

/* ================= SEARCH ================= */
.search-container {
    max-width: 600px;
    margin: 0 auto 50px;
    display: flex;
    gap: 10px;
    animation: slideDown 0.5s ease-out;
}

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

.search-container input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #eee;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.search-container input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
    transform: scale(1.02);
}

.search-container button {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-container button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.search-container button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-container button:active::before {
    width: 300px;
    height: 300px;
}

/* ================= GRID ================= */
.accommodations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 25px;
}

/* ================= CARD ================= */
.housing-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid #f0f0f0;
    position: relative;
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

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

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

.housing-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-green);
}

.housing-card:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--dark-green));
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* image */
.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.housing-card:hover img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.1) contrast(1.05);
}

.card-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(46, 204, 113, 0) 0%, rgba(46, 204, 113, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.housing-card:hover .card-img-wrapper::after {
    opacity: 1;
}

/* content */
.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.card-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.card-price {
    font-weight: bold;
    color: var(--dark-green);
    font-size: 1.2rem;
}

/* ================= DETAILS BUTTON ================= */
.details-btn {
    display: block;
    text-align: center;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    border: none;
}

.details-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.details-btn:active {
    transform: scale(0.98);
}

/* shine effect */
.details-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

.details-btn:hover::after {
    left: 100%;
}

/* pulse effect on load */
.details-btn {
    animation: pulse 1s infinite;
    -webkit-animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 5px 12px rgba(0,0,0,0.15); }
    50% { box-shadow: 0 5px 15px rgba(46, 204, 113, 0.2); }
    100% { box-shadow: 0 5px 12px rgba(0,0,0,0.15); }
}

/* ================= LOAD MORE ================= */
.load-more-wrapper {
    text-align: center;
    margin-top: 50px;
}

.custom-btn-outline {
    background: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.custom-btn-outline:hover {
    background: var(--primary-green);
    color: white;
}

/* ================= DETAILS PAGE ================= */
.details-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.info-section { 
    padding: 40px; 
}

.info-label { 
    font-weight: bold; 
    color: #555; 
    display: inline-block; 
    width: 120px; 
}

.price-tag { 
    font-size: 30px; 
    color: var(--primary-green); 
    font-weight: 800; 
}

/* buttons */
.btn-whatsapp { 
    background-color: #25D366; 
    color: white; 
    font-weight: bold;
    border-radius: 8px;
    transition: 0.3s;
}

.btn-whatsapp:hover { 
    background-color: #1eb954; 
    transform: scale(1.05);
}

.btn-call {
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    transition: 0.3s;
}

.btn-call:hover {
    background-color: #0056b3;
}

/* thumbnails */
.thumb-img {
    transition: 0.3s;
    border: 2px solid transparent;
    border-radius: 8px;
}

.thumb-img:hover {
    border-color: var(--primary-green);
    opacity: 0.8;
    transform: scale(1.05);
}

/* divider */
hr { 
    opacity: 0.1; 
}
.fav-btn {
    position: absolute;
    top: 15px;
    left: 15px; /* غيرتها لليسار عشان متداريش الـ Badge لو موجود */
    background: rgba(255, 255, 255, 0.7); /* خلفية بيضاء شفافة */
    backdrop-filter: blur(5px); /* تأثير زجاجي */
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 5;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* أنيميشن ناعم */
}

/* الأيقونة نفسها (القلب) */
.fav-btn i {
    color: #b1b1b1; /* لون رمادي هادي قبل الاختيار */
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

/* حالة الاختيار (لما القلب يبقى Active) */
.fav-btn.active {
    background: #fff;
}

.fav-btn.active i {
    color: #ff4d4d; /* اللون الأحمر الحيوي */
    transform: scale(1.2); /* تكبير بسيط للقلب */
}

/* أنيميشن عند الوقوف بالماوس (Hover) */
.fav-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 77, 77, 0.2);
}

/* تأثير "النبض" لما تضغط عليه */
.fav-btn:active {
    transform: scale(0.9);
}

/* تحسين شكل القائمة الجانبية (Sidebar) */
#favoriteSidebar {
    border-radius: 0 20px 20px 0; /* حواف دائرية للمنيو */
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
}

.offcanvas-header {
    background: linear-gradient(135deg, #198754, #28a745) !important;
}

/* تنسيق عناصر المفضلة جوه المنيو */
#fav-items-container .d-flex {
    transition: background 0.3s;
    border-radius: 10px;
    padding: 10px;
}

#fav-items-container .d-flex:hover {
    background-color: #f8f9fa;
}
