/* Professional slider/carousel controls (brand-themed) */
.tns-controls button,
.carousel-control-prev,
.carousel-control-next {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(var(--brand-primary-rgb), 0.22);
}

.tns-controls button:hover,
.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: var(--brand-primary-dk-10);
    color: var(--brand-on-primary);
}

.tns-controls button:focus-visible,
.carousel-control-prev:focus-visible,
.carousel-control-next:focus-visible {
    outline: 3px solid var(--brand-primary-dk-30);
    outline-offset: 2px;
}

/* Position adjustments for carousel arrows */
.carousel-control-prev,
.carousel-control-next {
    opacity: 0.95;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

/* UI/UX Enhancements - Social Icons & Interactive Elements */
/* Spacing & layout polish */
.section,
.section-properties {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.property-item {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.property-item .img img {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.property-item .property-content {
    padding: 1rem 1.05rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-item .price {
    font-weight: 600;
}

.property-item .specs {
    gap: .75rem;
}

.property-item .badge {
    font-size: .65rem;
    letter-spacing: .5px;
}

.property-item .icon-link {
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.property-item .icon-link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* Consistent gaps for icon rows */
.property-item .d-flex.gap-3,
.property-item .d-flex.gap-2 {
    margin-top: .35rem;
}

/* Dropdown caret rotation on existing pseudo-element */
.site-nav .site-navigation .site-menu .has-children>a:before {
    transition: transform .3s ease;
}

.site-nav .site-navigation .site-menu .has-children.open>a:before {
    transform: rotate(180deg);
}

/* Mobile menu spacing */
#site-mobile-menu .site-mobile-menu-body ul {
    padding: .75rem 0;
}

#site-mobile-menu .site-mobile-menu-body li {
    margin: .15rem 0;
}

#site-mobile-menu .site-mobile-menu-body a {
    padding: .55rem 1rem;
    display: block;
}

/* Social Icon Hover Effects */
.social a,
a[class*="icon-"] {
    transition: all 0.3s ease;
}

.social a:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

/* Icon-only Links Styling */
a[data-bs-toggle="tooltip"],
a[title] {
    text-decoration: none;
    transition: all 0.3s ease;
}

a[data-bs-toggle="tooltip"]:hover,
a[title]:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

/* Icon link circles for property cards */
.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
}

.icon-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    text-decoration: none;
}

/* Smaller icon links for compact cards */
.icon-link-sm {
    width: 2rem;
    height: 2rem;
}

.icon-link-sm:hover {
    transform: translateY(-1px);
}

/* Copy Icon Styling */
a[data-copy-id] {
    cursor: pointer;
    transition: all 0.2s ease;
}

a[data-copy-id]:hover {
    color: var(--bs-primary) !important;
    transform: scale(1.15);
}

/* Brand color circle wrappers (apply to <a>) */
.icon-link {
    color: #fff;
}

.icon-link-whatsapp {
    background-color: #25D366;
    color: #fff;
}

.icon-link-telegram {
    background-color: #0088cc;
    color: #fff;
}

.icon-link-instagram {
    background-color: #E4405F;
    color: #fff;
}

.icon-link-facebook {
    background-color: #1877F2;
    color: #fff;
}

.icon-link-twitter {
    background-color: #1DA1F2;
    color: #fff;
}

.icon-link-linkedin {
    background-color: #0A66C2;
    color: #fff;
}

.icon-link-email {
    background-color: #EA4335;
    color: #fff;
}

/* Remove previous glyph color overrides to allow contrast (glyph inherits white from parent) */
/* If needed, explicit glyph recolor: span.icon-whatsapp { color:#fff; } */

/* Text color utilities for social icons */
.text-whatsapp {
    color: #25D366 !important;
}

.text-telegram {
    color: #0088cc !important;
}

/* Enhanced Contact Buttons in partials */
.contact-channels-enhanced .btn {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.contact-channels-enhanced .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Share Icons Container */
.share-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.share-icons a {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.share-icons a:hover {
    transform: translateY(-3px);
}

/* Booking Channel Icons */
#booking-channels-container a {
    transition: all 0.3s ease;
}

#booking-channels-container a:hover {
    transform: scale(1.15);
}

/* Admin Copy Icons */
.admin-main a[data-copy-id] {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem;
}

/* Toast Notifications Enhancement */
.alert.position-fixed {
    animation: slideInDown 0.3s ease, slideOutUp 0.3s ease 1.7s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

/* Quick Actions Section */
.quick-actions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.75rem;
}

.quick-actions a {
    transition: all 0.3s ease;
}

.quick-actions a:hover {
    transform: scale(1.2);
}

/* Dark mode adjustments */
body.dark .quick-actions {
    background: #1a1a2e;
}

/* Tooltip customization */
.tooltip-inner {
    background-color: #2c3e50;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #2c3e50;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #2c3e50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .share-icons a {
        font-size: 1.25rem;
    }

    #booking-channels-container {
        justify-content: center;
    }
}

/* Focus states for accessibility */
a[data-bs-toggle="tooltip"]:focus,
a[data-copy-id]:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Icon link animations */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.icon-link-pulse:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Removed duplicate caret span; keep pseudo-element visible */

/* Home hero CTA spacing refinement */
.home-hero-cta {
    position: relative;
    z-index: 12;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.home-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

/* Tables and buttons polish */
.table-custom {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table-custom thead th {
    background: transparent;
    border-bottom: 0;
    color: var(--bs-gray-700);
    font-weight: 600;
    padding: .75rem 1rem;
}

.table-custom tbody tr {
    background: #fff;
    box-shadow: 0 6px 18px rgba(11, 28, 62, 0.04);
    border-radius: 8px;
}

.table-custom td,
.table-custom th {
    vertical-align: middle;
    border: 0;
    padding: .75rem 1rem;
}

.btn-sm-custom {
    padding: .35rem .6rem;
    font-size: .85rem;
    border-radius: .5rem;
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn-sm-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Admin-specific responsive tweaks for menus */
@media (max-width: 992px) {
    .admin-brand .brand-title {
        display: none;
    }

    .admin-brand .admin-logo {
        max-height: 36px;
    }
}

/* Button and modal polish (global) */
.btn,
.btn-primary,
.btn-outline-primary {
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-primary-dk-40);
    border-radius: .4rem;
}

/* Consistent button sizing */
.btn-xs {
    padding: .2rem .4rem;
    font-size: .75rem;
    line-height: 1.35;
    border-radius: .25rem;
}

.btn-sm {
    padding: .35rem .6rem;
    font-size: .875rem;
    line-height: 1.4;
    border-radius: .3rem;
}

/* Disabled state consistency */
.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.modal .modal-content {
    transition: transform .18s ease, opacity .18s ease;
}

/* Ensure tooltips use brand contrast */
.tooltip-inner {
    background-color: var(--brand-primary);
    color: var(--brand-contrast, #fff);
}

/* Brand badge utility - centralize badge color usage */
.badge-brand {
    background: var(--brand-primary) !important;
    color: var(--brand-contrast, #fff) !important;
    border-radius: .375rem;
    padding: .25rem .45rem;
    font-weight: 600;
    display: inline-block;
}

.badge-brand:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.14);
}

/* Ensure admin-specific table rows adopt brand-aware backgrounds */
.admin-main .table-custom tbody tr {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.98));
}

/* Compact admin utilities */
.admin-quick-actions .btn {
    padding: .4rem .6rem;
    border-radius: .5rem;
}

/* High-contrast focus ring using CSS variable for accessibility */
:focus {
    outline: 3px solid rgba(var(--brand-primary-rgb), 0.35);
    outline-offset: 2px;
}

/* Hero slider fixes removed - consolidated into style.css */
/* See style.css for unified hero section styling */

/* Mobile hero responsive adjustments - work with style.css rules */
@media (max-width: 768px) {

    .hero,
    .hero>.container,
    .hero>.container>.row {
        min-height: 500px;
        height: auto;
    }

    /* Let the slider background track the full hero height on small screens */
    .hero-slide {
        min-height: 500px;
        height: 100%;
        bottom: 0;
    }

    .hero-slide .img {
        min-height: 500px;
        height: 100%;
        background-size: cover;
        background-position: center;
    }
}

/* ============================================ */
/* Responsive images and image optimization */
/* ============================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lazy-loaded image placeholder styling */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Property images - maintain aspect ratio */
.property-item .img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.property-item .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero background image optimization */
.bg-hero-1,
.bg-hero-2,
.bg-hero-3 {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Responsive image scaling for different screen sizes */
@media (max-width: 768px) {

    /* Reduce quality demand on mobile for faster loading */
    .property-item .img {
        aspect-ratio: 4 / 3;
    }

    .hero-slide .img {
        background-size: cover;
        background-position: center;
    }
}

@media (max-width: 480px) {

    /* Extra compact on tiny screens */
    .property-item .img {
        aspect-ratio: 3 / 2;
        min-height: 150px;
    }

    .hero-slide .img {
        min-height: 300px;
    }
}

/* ============================================ */
/* Ultra-small mobile enhancements (≤480px) */
/* ============================================ */
@media (max-width: 480px) {

    /* Reduce spacing on very small screens */
    .section,
    .section-properties {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .property-item .property-content {
        padding: 0.75rem;
    }

    .property-item .specs {
        gap: 0.5rem;
    }

    /* Tighter button spacing */
    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Reduce icon sizes on tiny screens */
    .icon-link {
        width: 2rem;
        height: 2rem;
    }

    .icon-link-sm {
        width: 1.75rem;
        height: 1.75rem;
    }

    /* Tighter form spacing */
    .form-control,
    .form-select {
        min-height: 40px;
        padding: 0.5rem 0.625rem;
        font-size: 16px;
    }

    /* Reduce carousel control button size */
    .tns-controls button,
    .carousel-control-prev,
    .carousel-control-next {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    /* Compact testimonial slider on tiny screens */
    .testimonial {
        padding: 1rem;
    }

    .testimonial img {
        max-width: 80%;
    }
}

/* ============================================ */
/* Small mobile optimizations (481-575px) */
/* ============================================ */
@media (min-width: 481px) and (max-width: 575px) {

    .section,
    .section-properties {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ============================================ */
/* Responsive typography with fluid scaling */
/* ============================================ */
@media (max-width: 768px) {

    h1,
    .h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    h2,
    .h2 {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
    }

    h3,
    .h3 {
        font-size: clamp(1rem, 3vw, 1.35rem);
    }

    .heading {
        font-size: clamp(1rem, 3vw, 1.5rem);
    }

    p {
        font-size: clamp(0.875rem, 1.5vw, 1rem);
        line-height: 1.6;
    }

    .btn-sm-custom {
        font-size: clamp(0.75rem, 1vw, 0.85rem);
    }
}

/* ============================================ */
/* Safe area support for notched devices */
/* ============================================ */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .site-nav {
        padding-left: max(0, env(safe-area-inset-left));
        padding-right: max(0, env(safe-area-inset-right));
    }

    .site-footer {
        padding-left: max(1.5rem, calc(1.5rem + env(safe-area-inset-left)));
        padding-right: max(1.5rem, calc(1.5rem + env(safe-area-inset-right)));
    }
}

/* ============================================ */
/* Card Component Consistency */
/* ============================================ */
.card {
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

/* Admin Cards */
.admin-main .card {
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.admin-main .card-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dk-10) 100%);
    color: var(--brand-on-primary);
    border-bottom: none;
}

/* Service Cards on Homepage */
.box-feature {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.box-feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--brand-primary);
}

.box-feature h3 {
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.box-feature .learn-more {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.box-feature .learn-more:hover {
    color: var(--brand-primary-dk-15);
    text-decoration: underline;
}

/* Testimonial Cards */
.testimonial {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.testimonial img {
    object-fit: cover;
    max-width: 120px;
    width: 100%;
    height: auto;
}

.testimonial .blockquote {
    border-left: 4px solid var(--brand-primary);
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .testimonial {
        padding: 1.5rem 1rem;
        min-height: 280px;
    }

    .testimonial img {
        max-width: 80px;
    }
}

/* Property Cards Enhancement */
.property-item {
    border: 1px solid #e9ecef;
    border-radius: 0.625rem;
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
}

.property-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--brand-primary);
}

.property-item .img {
    overflow: hidden;
    border-radius: 0.625rem 0.625rem 0 0;
}

.property-item .img img {
    transition: transform 0.4s ease;
}

.property-item:hover .img img {
    transform: scale(1.05);
}

/* ============================================ */
/* Form Consistency Enhancements */
/* ============================================ */
.form-control,
.form-select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.2rem var(--brand-primary-dk-40);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Input Groups */
.input-group .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: none;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

/* ============================================ */
/* Table Enhancements */
/* ============================================ */
.table-custom tbody tr:hover {
    background: linear-gradient(90deg, #fafbfc 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Striped tables */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(var(--brand-primary-rgb), 0.02);
}

/* ============================================ */
/* Alert and Message Styling */
/* ============================================ */
.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
}

.alert-info {
    border-left-color: var(--brand-primary);
    background-color: rgba(var(--brand-primary-rgb), 0.1);
}