/* Chofli Platform - Custom Styles */

/* Import Noto Kufi Arabic Font */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Global Font Settings */
* {
    font-family: 'Noto Kufi Arabic', sans-serif !important;
}

/* Typography Improvements */
.text-5xl {
    font-size: 2.5rem !important; /* md:text-5xl = 2.5em */
    line-height: 1.2;
}

.text-4xl {
    font-size: 2rem !important;
    line-height: 1.3;
}

.text-3xl {
    font-size: 1.75rem !important;
    line-height: 1.3;
}

.text-2xl {
    font-size: 1.5rem !important;
    line-height: 1.4;
}

.text-xl {
    font-size: 1.25rem !important;
    line-height: 1.4;
}

.text-lg {
    font-size: 1.125rem !important;
    line-height: 1.5;
}

/* Button Styling Improvements */
.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Icon and Text Spacing - Enhanced for Arabic RTL */
.icon-fix, .icon-text-spacing {
    margin-right: 0 !important;
    margin-left: 5px !important; /* 3px spacing to the left for Arabic */
    display: inline-block !important;
}

.btn-icon {
    margin-right: 0 !important;
    margin-left: 5px !important; /* 3px for button icons to the left */
    display: inline-block !important;
}

.nav-icon {
    margin-right: 0 !important;
    margin-left: 5px !important; /* 3px for navigation icons to the left */
    display: inline-block !important;
}

.card-icon {
    margin-right: 0 !important;
    margin-left: 5px !important; /* 3px for card icons to the left */
    display: inline-block !important;
}

/* Property card specific icons */
.property-icon {
    margin-right: 0 !important;
    margin-left: 5px !important; /* 3px for property details */
    display: inline-block !important;
    color: inherit !important;
}

/* Search and filter icons */
.search-icon {
    margin-right: 0 !important;
    margin-left: 5px !important;
    display: inline-block !important;
}

/* General icon spacing for RTL */
[dir="rtl"] i,
[dir="rtl"] .fas,
[dir="rtl"] .far,
[dir="rtl"] .fab {
    margin-right: 0 !important;
    margin-left: 5px !important;
}

/* Override Tailwind margins for icons in RTL */
[dir="rtl"] .mr-2, [dir="rtl"] .mr-3, [dir="rtl"] .mr-4 {
    margin-right: 0 !important;
    margin-left: 5px !important;
}

/* Force Font Awesome to display - Enhanced */
.fas, .far, .fab, .fal, .fa-solid, .fa-regular, .fa-brands, .fa-light,
i[class*="fa-"], i[class*="fas"], i[class*="far"], i[class*="fab"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    margin-left:5px !important;
}

/* Specific Font Awesome classes */
.fa-solid, .fas {
    margin-left: 5px !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.fa-regular, .far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.fa-brands, .fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Enhanced Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

/* Card Enhancements */
.property-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Image Counter Badge */
.image-counter {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* Favorite Heart Icon */
.favorite-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.favorite-btn.active:hover {
    background: rgba(239, 68, 68, 1);
}

/* Price Display Enhancements */
.price-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.price-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.price-currency {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

/* Price Input Enhancements */
.price-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input {
    padding-left: 120px !important;
}

.price-selector {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    z-index: 10;
}

.price-selector:hover {
    background: #f3f4f6;
}

/* Price formatting for different currencies */
.price-dzd::after {
    content: " دج";
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.price-million::after {
    content: " مليون دج";
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.price-billion::after {
    content: " مليار دج";
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Service Icons Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.service-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.service-item:hover {
    background: #e5e7eb;
}

.service-item i {
    margin-left: 0.5rem;
    color: #3b82f6;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .text-5xl {
        font-size: 2rem !important;
    }
    
    .text-4xl {
        font-size: 1.75rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .property-card {
        margin-bottom: 1rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
}

/* Service icons specific */
.service-icon {
    color: inherit !important;
    font-size: 1em !important;
    margin: 0 !important;
}

/* Force icon display - Critical fix */
i {
    font-style: normal !important;
    display: inline-block !important;
}

/* Ensure Font Awesome loads properly */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-regular-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/webfonts/fa-brands-400.woff2') format('woff2');
}

/* Icon fallback content */
.fas.fa-home::before { content: "🏠"; }
.fas.fa-search::before { content: "🔍"; }
.fas.fa-map-marker-alt::before { content: "📍"; }
.fas.fa-bed::before { content: "🛏️"; }
.fas.fa-bath::before { content: "🛁"; }
.fas.fa-ruler-combined::before { content: "📏"; }
.fas.fa-eye::before { content: "👁️"; }
.fas.fa-heart::before { content: "❤️"; }
.fas.fa-star::before { content: "⭐"; }
.fas.fa-images::before { content: "🖼️"; }
.fas.fa-chevron-right::before { content: "◀"; }
.fas.fa-chevron-left::before { content: "▶"; }

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Focus States */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
