/**
 * Homepage Specific Styles
 * Extracted from home.php for better organization
 * Enhanced with UX improvements and mobile-first design
 */

/* ===================================
   Search Results Dropdown
   =================================== */
#results_row {
    display: none;
    height: 200px;
    overflow-y: auto;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    position: absolute;
    width: 100%;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: scaleY(0.8) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scaleY(1) translateY(0);
    }
}

#results_row ul {
    color: #000;
    list-style-type: none;
    background-color: #ffffff;
    text-align: left;
    padding: 0;
    margin: 0;
}

#results_row li {
    margin: 8px 4px;
    font-size: 14px;
    color: #333;
    max-height: 50px;
    padding: 8px 12px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

#results_row li:hover {
    border-left-color: #08c268;
    padding-left: 15px;
}

#results_row li a {
    font-size: 16px;
    color: #08c268;
    text-decoration: none;
    display: block;
}

#results_row li a:hover {
    border-radius: 6px;
    background-color: rgba(8, 194, 104, 0.1);
    color: #08c268;
    text-decoration: none;
}

/* ===================================
   Enhanced Search Interface
   =================================== */
#search {
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0 !important;
}

#search:focus {
    border-color: #08c268 !important;
    box-shadow: 0 0 0 4px rgba(8, 194, 104, 0.1) !important;
    outline: none !important;
}

/* ===================================
   RERA Badge Styling
   =================================== */
.reratext {
    background: #f1f1f2;
    color: #6d6e70;
    padding: 5px 10px;
    border-radius: 50px;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    font-weight: 600;
    justify-content: center;
    width: 70px;
    flex: 0 0 70px;
}

.reratext i {
    line-height: 1;
    width: 13px;
    height: 13px;
    background: #009200;
    border-radius: 100%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    font-size: 9px;
}

/* ===================================
   Property Card Enhancements with Animations
   =================================== */
.property-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Stagger animation for cards */
.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;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.property-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.property-title a {
    color: #161e2d;
    transition: color 0.3s ease;
}

.property-title a:hover {
    color: #08c268;
}

/* ===================================
   Favorite & Comparison Buttons
   =================================== */
.btn-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 10;
}

.btn-favorite:hover {
    background: #fff;
    transform: scale(1.15);
}

.btn-favorite i {
    font-size: 18px;
    color: #666;
    transition: color 0.3s ease;
}

.btn-favorite.active i {
    color: #ff4757;
}

.btn-favorite:hover i {
    color: #ff4757;
}

.comparison-check {
    position: relative;
}

.comparison-check input[type="checkbox"] {
    display: none;
}

.comparison-check label {
    cursor: pointer;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.comparison-check label i {
    font-size: 16px;
    color: #666;
}

.comparison-check input:checked+label {
    background: #08c268;
    border-color: #08c268;
    transform: scale(1.05);
}

.comparison-check input:checked+label i {
    color: #fff;
}

/* ===================================
   Property Actions (CTA Buttons with Micro-interactions)
   =================================== */
.property-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.action-buttons {
    flex: 1;
}

.buttonSmall {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.buttonSmall::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.buttonSmall:active::before {
    width: 300px;
    height: 300px;
}

.btn-secondary:hover {
    background-color: #555;
    transform: translateY(-2px);
}

.btn-success:hover {
    background-color: #25d366;
    transform: translateY(-2px);
}

/* ===================================
   Skeleton Loaders
   =================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 400px;
    border-radius: 8px;
}

.skeleton-image {
    height: 230px;
    border-radius: 8px 8px 0 0;
}

.skeleton-text {
    height: 16px;
    margin: 12px 0;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    width: 80%;
    margin: 12px 0;
    border-radius: 4px;
}

/* ===================================
   Floating Comparison Bar
   =================================== */
.comparison-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 24px;
    z-index: 1000;
    transition: bottom 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.comparison-bar.active {
    bottom: 0;
}

.comparison-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comparison-count {
    font-size: 16px;
    font-weight: 600;
    color: #161e2d;
}

.comparison-actions {
    display: flex;
    gap: 12px;
}

/* ===================================
   Loading States
   =================================== */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #08c268;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Tab Transitions
   =================================== */
.tab-pane {
    animation: fadeIn 0.4s ease-in-out;
}

.tab-pane.fade:not(.show) {
    opacity: 0;
}

/* ===================================
   Smooth Scroll & Visual Polish
   =================================== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .property-card,
    .btn-favorite,
    .buttonSmall {
        animation: none !important;
        transition: none !important;
    }
}

/* ===================================
   Social Sharing
   =================================== */
.property-share {
    position: relative;
    display: inline-block;
}

.btn-share {
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.btn-share:hover {
    background: #08c268;
    color: #fff;
    border-color: #08c268;
}

.btn-share i {
    font-size: 16px;
}

.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100;
    animation: slideDown 0.2s ease;
    overflow: hidden;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.share-option:last-child {
    border-bottom: none;
}

.share-option:hover {
    background: #f8f8f8;
}

.share-option i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.share-whatsapp:hover {
    background: #e7f7ef;
    color: #25d366;
}

.share-facebook:hover {
    background: #e7f1fc;
    color: #1877f2;
}

.share-twitter:hover {
    background: #e8f5fe;
    color: #1da1f2;
}

.share-copy:hover {
    background: #e7f7ef;
    color: #08c268;
}

/* Touch feedback */
.card-touchable {
    -webkit-tap-highlight-color: rgba(8, 194, 104, 0.1);
}

.card-touchable:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* ===================================
   Responsive Design - Mobile First
   =================================== */

/* Tablet */
@media (max-width: 992px) {
    .property-card {
        margin-bottom: 24px;
    }

    .property-card:hover {
        transform: translateY(-2px);
    }
}

/* Mobile - Large */
@media (max-width: 768px) {
    #results_row {
        height: 150px;
    }

    .property-title {
        font-size: 16px;
    }

    .property-actions {
        flex-direction: column;
        gap: 12px;
    }

    .action-buttons {
        width: 100%;
    }

    .buttonSmall {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        /* Touch target */
    }

    .comparison-bar-content {
        flex-direction: column;
        gap: 12px;
    }

    /* Hero section mobile */
    h1.title {
        font-size: 32px !important;
        line-height: 1.2 !important;
    }

    .subtitle {
        font-size: 14px !important;
    }

    /* Search form mobile */
    .wd-find-select .inner-group {
        flex-direction: column;
        gap: 12px;
    }

    .form-group-1,
    .form-group-2,
    .form-group-3 {
        width: 100% !important;
    }

    .nice-select,
    #search {
        min-height: 48px;
        font-size: 16px;
        /* Prevent iOS zoom */
    }
}

/* Mobile - Small */
@media (max-width: 576px) {
    .property-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin-bottom: 20px;
    }

    .property-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }
}

/* Mobile - Extra Small */
@media (max-width: 480px) {
    .btn-favorite {
        width: 36px;
        height: 36px;
    }

    .btn-favorite i {
        font-size: 16px;
    }

    #results_row {
        height: 120px;
    }

    .property-title {
        font-size: 15px;
    }
}