/* Custom Styles - Tailwind Additions */

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Property favorite button active state */
.property-favorite.active i {
    color: #f59e0b;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* No scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background: #22c55e;
}

.toast-error {
    background: #ef4444;
}

.toast-warning {
    background: #f59e0b;
}

.toast-info {
    background: #3b82f6;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #64748b;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 24px;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1e293b;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Image gallery */
.image-gallery {
    position: relative;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

.thumbnails-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.thumb-item {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumb-item:hover {
    opacity: 0.8;
}

.thumb-item.active {
    border-color: #2563eb;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled) {
    border-color: #2563eb;
    color: #2563eb;
}

.page-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #1e293b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-image {
        height: 250px;
    }

    .modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
}

/* User Avatar & Login Styles */
.user-avatar-container {
    padding: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container:hover .user-avatar-container,
#userMenuBtn:hover .user-avatar-container {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(5deg) scale(1.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFDA00;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Force icon visibility and color */
.user-avatar i {
    color: #172B4D !important;
    font-size: 1.1rem !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Maintain yellow brand color everywhere */
.header-housing.scrolled .user-avatar,
.bg-white .user-avatar {
    background: #FFDA00;
    border-color: rgba(0, 0, 0, 0.1);
}

.header-housing.scrolled .user-avatar i,
.bg-white .user-avatar i {
    color: #172B4D !important;
}

.login-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #172B4D;
    background: #FFDA00;
    border: 2px solid white;
    transition: all 0.3s;
}

.login-text-btn {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Reference UI Refinements */
.price-badge-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a2a47;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.property-heart-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    /* Adjusted for better visibility */
    transition: transform 0.2s;
    z-index: 10;
}

.property-heart-btn:hover {
    transform: scale(1.15);
}

.property-heart-btn.active i {
    color: #f54d6e;
    font-weight: 900;
}

.media-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    background: rgba(0, 0, 0, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-meta-info {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

.rera-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Horizontal Scroll Container */
.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    margin: -0.5rem -0.5rem -1rem -0.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.horizontal-scroll-container article {
    flex: 0 0 calc(33.333% - 1rem);
    min-width: 300px;
    max-width: 360px;
    scroll-snap-align: start;
}

@media (max-width: 1024px) {
    .horizontal-scroll-container article {
        flex: 0 0 calc(50% - 0.75rem);
    }
}

@media (max-width: 640px) {
    .horizontal-scroll-container article {
        flex: 0 0 85%;
        min-width: 280px;
    }
}
