/**
 * Custom CSS - Additional Styles
 * Hanurental Solutions Theme
 */

/* ==========================================================================
   LUCIDE ICON FIXES - ENSURE SVG ICONS ALWAYS RENDER
   ========================================================================== */

/* Hide any un-rendered icon elements (prevents emoji/text fallback) */
i[data-lucide]:not(svg) {
    display: inline-block;
    width: 1em;
    height: 1em;
    min-width: 16px;
    min-height: 16px;
}

/* Ensure Lucide SVG icons render properly */
i[data-lucide] svg,
svg.lucide {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
}

/* Force icon visibility */
.category-icon i[data-lucide],
.stat-item i[data-lucide],
.property-location i[data-lucide],
.gallery-indicator i[data-lucide],
.directions-btn i[data-lucide] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   BUTTON ICON SPACING FIXES
   ========================================================================== */

/* Fix icon spacing in all buttons */
.btn svg,
.btn i[data-lucide],
button svg,
button i[data-lucide],
a.btn svg,
a.btn i[data-lucide] {
    margin-right: 0.5rem;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Contact buttons specific spacing */
.btn-contact,
.action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-contact svg,
.action-btn svg,
.btn-contact i,
.action-btn i {
    margin-right: 0;
    flex-shrink: 0;
}

/* Property contact buttons container */
.property-contact-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Quick actions buttons */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.quick-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* ==========================================================================
   ADDITIONAL UTILITY CLASSES
   ========================================================================== */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    .md\\:block {
        display: block;
    }
    
    .md\\:hidden {
        display: none;
    }
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: hsl(var(--muted-foreground));
}

.loading::after {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 3px solid hsl(var(--border));
    border-top-color: hsl(var(--brand-blue));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   BACK TO TOP BUTTON
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: hsl(var(--brand-blue));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 78, 152, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: hsl(206 100% 25%);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 78, 152, 0.4);
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ==========================================================================
   MOBILE FILTER OVERLAY
   ========================================================================== */

@media (max-width: 767px) {
    .listings-sidebar.mobile-active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: hsl(var(--background));
        overflow-y: auto;
        padding: 2rem 1rem;
        animation: slide-in-left 0.3s ease-out;
    }
    
    body.filter-open {
        overflow: hidden;
    }
}

@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 0.5rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    text-decoration: none;
    color: hsl(var(--foreground));
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background: hsl(var(--secondary));
    border-color: hsl(var(--brand-blue));
}

.pagination-link.active {
    background: hsl(var(--brand-blue));
    color: white;
    border-color: hsl(var(--brand-blue));
}

.pagination-dots {
    padding: 0.5rem;
    color: hsl(var(--muted-foreground));
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.breadcrumbs a {
    color: hsl(var(--brand-blue));
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: hsl(206 100% 25%);
}

.breadcrumbs .separator {
    color: hsl(var(--muted-foreground));
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: hsl(var(--brand-blue));
    box-shadow: 0 0 0 3px rgba(0, 78, 152, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   RESPONSIVE IMAGES
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
}

.wp-post-image {
    display: block;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: hsl(var(--brand-blue));
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid hsl(var(--brand-blue));
    outline-offset: 2px;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .quick-actions,
    .contact-card {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
    
    .property-info-card,
    .property-map-card {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   WORDPRESS SPECIFIC
   ========================================================================== */

.sticky {
    /* Styles for sticky posts */
}

.bypostauthor {
    /* Styles for post author */
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-item {
    margin: 0;
}

.gallery-icon img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 639px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 640px) {
    .sm\\:text-lg {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .md\\:text-xl {
        font-size: 1.25rem;
    }
    
    .md\\:text-2xl {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .lg\\:text-3xl {
        font-size: 1.875rem;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT (Optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if needed */
}


/* ==========================================================================
   SEARCH BAR ICON FIX
   ========================================================================== */

/* Fix location pin icon overlap in search bar */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: hsl(var(--muted-foreground));
    width: 18px;
    height: 18px;
}

.autocomplete-wrapper .search-input {
    padding-left: 40px !important;
}

/* Ensure proper spacing for location input */
.locality-search-wrapper .search-input {
    width: 100%;
}


/* ==========================================================================
   POST PROPERTY PAGE - MOBILE RESPONSIVE
   ========================================================================== */

/* Mobile responsive fixes for Post Property page */
@media (max-width: 768px) {
    .post-property-wrapper {
        padding: 1rem;
    }
    
    .post-property-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .post-property-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .post-property-header .subtitle {
        font-size: 0.875rem;
    }
    
    /* Form sections */
    .form-section {
        margin-bottom: 2rem;
        padding: 1rem;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid hsl(var(--primary));
    }
    
    /* Form rows - stack on mobile */
    .form-row {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        font-size: 0.875rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 1rem;
    }
    
    .form-group textarea {
        min-height: 120px;
        resize: vertical;
    }
    
    /* File upload */
    .form-group input[type="file"] {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Required asterisk */
    .required {
        color: #d63638;
    }
    
    /* Submit button */
    .property-form button[type="submit"] {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1.5rem;
    }
    
    /* Image preview grid */
    .image-preview-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .image-preview-item {
        position: relative;
        aspect-ratio: 1;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .image-preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .image-preview-remove {
        position: absolute;
        top: 0.25rem;
        right: 0.25rem;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        border: none;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}

/* Tablet responsive (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .form-row .form-group:only-child {
        grid-column: 1 / -1;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1025px) {
    .form-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .form-row.two-col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-preview-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
