/**
 * Luxe Nest - Custom Responsive & UI Enhancements
 * Premium Interior Design Theme Optimizations
 */

/* ============================================
   GLOBAL FONT: INTER
   Override all fonts to use Inter only
   ============================================ */

/* Apply Inter globally */
*, *::before, *::after {
    font-family: 'Inter', sans-serif !important;
}

/* Base elements */
html { scroll-behavior: smooth; }
body {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, .h1 { font-weight: 700; }
h2, .h2, h3, .h3, h4, .h4 { font-weight: 600; }
h5, .h5, h6, .h6 { font-weight: 500; }

/* Override other fonts */
[class*="playfair"],
[class*="serif"],
[style*="Cal Sans"],
[style*="Golos Text"],
[style*="Playfair"] {
    font-family: 'Inter', sans-serif !important;
}

/* Bootstrap Icons - keep original font */
.bi,
[class^="bi-"],
[class*=" bi-"] {
    font-family: 'bootstrap-icons' !important;
}

/* ============================================
   ENHANCED TYPOGRAPHY & BASE
   ============================================ */

/* Selection color */
::selection {
    background: var(--luxe-primary);
    color: white;
}

::-moz-selection {
    background: var(--luxe-primary);
    color: white;
}

/* ============================================
   NAVBAR ENHANCEMENTS
   ============================================ */

.navbar {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    padding: 1.3rem 0 0.3rem 0 !important;
    box-shadow: 0 4px 20px rgba(74, 46, 31, 0.15);
}

.navbar-brand img {
    transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    height: 38px !important;
}

/* Mobile menu improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: white;
        padding: 1rem;
        margin-top: 1rem;
        border-radius: var(--luxe-radius-lg, 12px);
        box-shadow: 0 8px 32px rgba(74, 46, 31, 0.16);
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid #E3D0C3;
    }

    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }

    .navbar-nav .nav-link::after {
        display: none;
    }

    .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        background: #F0E6DC;
        border-radius: 8px;
        margin-top: 0.5rem;
    }
}

/* ============================================
   HERO SECTION IMPROVEMENTS
   ============================================ */

.luxe-hero {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .luxe-hero {
        background-attachment: scroll;
        min-height: 100vh;
        padding: 2rem 0;
    }

    .luxe-hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        line-height: 1.3;
    }

    .luxe-hero .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .luxe-hero .d-flex.gap-3 {
        flex-direction: column;
    }
}

/* ============================================
   STATS SECTION
   ============================================ */

.luxe-section-dark {
    position: relative;
}

.luxe-stat {
    position: relative;
}

.luxe-stat::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 1px;
    background: rgba(255,255,255,0.2);
}

.col-md-3:last-child .luxe-stat::after,
.col-6:last-child .luxe-stat::after {
    display: none;
}

@media (max-width: 767.98px) {
    .luxe-stat::after {
        display: none;
    }

    .luxe-stat-number {
        font-size: 1.75rem !important;
    }

    .luxe-stat-label {
        font-size: 0.75rem !important;
    }
}

/* ============================================
   PROJECT CARDS ENHANCEMENTS
   ============================================ */

.luxe-project-card {
    border: 1px solid transparent;
}

.luxe-project-card:hover {
    border-color: #C89A6A;
}

.luxe-project-image {
    position: relative;
}

.luxe-project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.luxe-project-card:hover .luxe-project-image::before {
    opacity: 1;
}

/* Featured badge */
.luxe-project-featured {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #8B5A3C;
    color: white;
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 5;
}

@media (max-width: 575.98px) {
    .luxe-project-image {
        height: 140px !important;
    }

    .luxe-project-content {
        padding: 0.75rem !important;
    }

    .luxe-project-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.3;
    }

    .luxe-project-excerpt {
        font-size: 0.75rem !important;
        display: none;
    }

    .luxe-project-card .luxe-project-info {
        font-size: 0.7rem !important;
        gap: 0.5rem !important;
    }

    .luxe-project-card .btn-sm {
        font-size: 0.75rem;
        padding: 0.35rem 0.75rem;
    }
}

/* Extra small screens (< 400px) */
@media (max-width: 399.98px) {
    .luxe-project-image {
        height: 120px !important;
    }

    .luxe-project-content {
        padding: 0.5rem !important;
    }

    .luxe-project-title {
        font-size: 0.8rem !important;
    }
}

/* ============================================
   BLOG CARDS ENHANCEMENTS
   ============================================ */

.luxe-blog-card {
    border: 1px solid transparent;
}

.luxe-blog-card:hover {
    border-color: #C89A6A;
}

.luxe-blog-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.luxe-blog-card:hover .luxe-blog-image::after {
    opacity: 1;
}

@media (max-width: 575.98px) {
    .luxe-blog-image {
        height: 120px !important;
    }

    .luxe-blog-content {
        padding: 0.75rem !important;
    }

    .luxe-blog-title {
        font-size: 0.85rem !important;
        line-height: 1.3;
        margin-bottom: 0.25rem !important;
    }

    .luxe-blog-meta {
        font-size: 0.7rem !important;
    }

    .luxe-blog-excerpt {
        display: none;
    }

    .luxe-blog-card .btn-link {
        font-size: 0.75rem;
    }
}

/* Extra small screens (< 400px) */
@media (max-width: 399.98px) {
    .luxe-blog-image {
        height: 100px !important;
    }

    .luxe-blog-content {
        padding: 0.5rem !important;
    }

    .luxe-blog-title {
        font-size: 0.8rem !important;
    }
}

/* ============================================
   SERVICE CARDS ENHANCEMENTS
   ============================================ */

.luxe-service-card {
    border: 1px solid #E3D0C3;
    position: relative;
    overflow: hidden;
}

.luxe-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #8B5A3C;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.luxe-service-card:hover::before {
    transform: scaleX(1);
}

.luxe-service-icon {
    transition: all 0.3s ease;
}

.luxe-service-card:hover .luxe-service-icon {
    background: #8B5A3C;
}

.luxe-service-card:hover .luxe-service-icon i {
    color: white;
}

@media (max-width: 767.98px) {
    .luxe-service-card {
        padding: 1.5rem !important;
    }

    .luxe-service-icon {
        width: 60px !important;
        height: 60px !important;
    }

    .luxe-service-icon i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .luxe-service-card {
        padding: 1rem !important;
        text-align: center;
    }

    .luxe-service-icon {
        width: 50px !important;
        height: 50px !important;
        margin: 0 auto 0.75rem !important;
    }

    .luxe-service-icon i {
        font-size: 1.25rem !important;
    }

    .luxe-service-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .luxe-service-desc {
        font-size: 0.75rem !important;
        line-height: 1.4;
    }

    .luxe-service-card .btn-link {
        font-size: 0.75rem;
    }
}

/* Extra small screens (< 400px) */
@media (max-width: 399.98px) {
    .luxe-service-card {
        padding: 0.75rem !important;
    }

    .luxe-service-icon {
        width: 40px !important;
        height: 40px !important;
    }

    .luxe-service-icon i {
        font-size: 1rem !important;
    }

    .luxe-service-title {
        font-size: 0.8rem !important;
    }
}

/* ============================================
   PAGE HEADERS
   ============================================ */

.luxe-page-header {
    margin-top: -76px;
    padding-top: 180px !important;
}

@media (max-width: 991.98px) {
    .luxe-page-header {
        padding: 140px 0 60px !important;
    }

    .luxe-page-header h1 {
        font-size: 1rem !important;
    }

    .luxe-page-header .lead {
        font-size: 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .luxe-page-header {
        padding: 120px 0 50px !important;
    }

    .luxe-header-badge {
        font-size: 0.75rem !important;
        padding: 6px 14px !important;
    }
}

/* ============================================
   FILTER CARDS
   ============================================ */

.luxe-filter-card {
    border: 1px solid #E3D0C3;
}

@media (max-width: 767.98px) {
    .luxe-filter-card {
        padding: 1.25rem !important;
    }

    .luxe-filter-card .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .luxe-filter-card .d-flex.gap-2 {
        flex-direction: column;
    }
}

/* ============================================
   SIDEBAR IMPROVEMENTS
   ============================================ */

.luxe-sidebar-widget {
    border: 1px solid #E3D0C3;
}

@media (max-width: 991.98px) {
    .luxe-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .luxe-cta-box {
        grid-column: span 2;
    }
}

@media (max-width: 575.98px) {
    .luxe-sidebar {
        grid-template-columns: 1fr;
    }

    .luxe-cta-box {
        grid-column: span 1;
    }
}

/* ============================================
   PAGINATION IMPROVEMENTS
   ============================================ */

@media (max-width: 575.98px) {
    .luxe-pagination {
        gap: 4px;
    }

    .luxe-page-link {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}

/* ============================================
   CONTACT FORM ENHANCEMENTS
   ============================================ */

.luxe-form-control:focus {
    box-shadow: 0 0 0 4px rgba(139, 90, 60, 0.1);
}

.luxe-form-control::placeholder {
    color: #B8AFA7;
    opacity: 0.7;
}

/* ============================================
   FOOTER IMPROVEMENTS
   ============================================ */

@media (max-width: 767.98px) {
    .luxe-footer {
        padding: 60px 0 0 !important;
        text-align: center;
    }

    .luxe-social-links {
        justify-content: center;
    }

    .luxe-footer h5 {
        margin-top: 1.5rem;
    }

    .luxe-contact-info li {
        justify-content: center;
        text-align: left;
    }

    .luxe-footer-bottom {
        margin-top: 40px !important;
    }
}

/* ============================================
   ABOUT PAGE IMAGE
   ============================================ */

.luxe-about-image {
    position: relative;
}

.luxe-about-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 3px solid #C89A6A;
    border-radius: 12px;
    z-index: -1;
}

@media (max-width: 991.98px) {
    .luxe-about-image::before {
        display: none;
    }

    .luxe-experience-badge {
        position: static !important;
        margin-top: 1rem;
        display: inline-block;
    }
}

/* ============================================
   BREADCRUMB STYLING
   ============================================ */

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: #8B5A3C;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #734830;
}

.breadcrumb-item.active {
    color: #B8AFA7;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #B8AFA7;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
    .luxe-fade-up {
        animation: luxeFadeUp 0.8s ease-out forwards;
    }

    .luxe-project-card,
    .luxe-blog-card,
    .luxe-service-card {
        transform: translateY(0);
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.3s ease,
                    border-color 0.3s ease;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.luxe-skeleton {
    background: linear-gradient(90deg,
        #F0E6DC 25%,
        #E7D4C4 50%,
        #F0E6DC 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #4A2E22;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(74, 46, 31, 0.12);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #3A231A;
    transform: translateY(-3px);
}

@media (max-width: 767.98px) {
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   IMAGE LAZY LOADING PLACEHOLDER
   ============================================ */

/* Note: Browser handles lazy loading natively, no need to hide images */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img.loading-error {
    opacity: 0.5;
}

/* ============================================
   DETAIL PAGE IMPROVEMENTS
   ============================================ */

/* Article/News detail content */
.article-content,
.article-content p,
.article-content div {
    text-align: justify;
    line-height: 1.8;
}

/* Product/Project detail content */
.project-content,
.project-content p,
.project-content div {
    text-align: justify;
    line-height: 1.8;
}

/* Service detail content */
.service-content,
.service-content p,
.service-content div {
    text-align: justify;
    line-height: 1.8;
}

/* Description/Comment sections */
.article-description,
.project-description,
.service-description,
.detail-description {
    text-align: justify;
    line-height: 1.8;
}

/* Generic content class */
.content {
    line-height: 1.8;
    text-align: justify;
}

.content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* CKEditor content output */
.ck-content,
.ck-content p,
[class*="-content"] p {
    text-align: justify;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .luxe-footer,
    .scroll-to-top,
    .luxe-cta-box,
    .btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .luxe-page-header {
        background: none !important;
        color: black !important;
        padding: 2rem 0 !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-balance {
    text-wrap: balance;
}

.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;
}

/* Aspect ratios */
.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

/* Object fit utilities */
.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

/* ============================================
   WHATSAPP/ZALO FLOATING BUTTON
   ============================================ */

.floating-contact {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 997;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(74, 46, 31, 0.25);
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.floating-btn:hover {
    transform: scale(1.1);
    color: white;
    box-shadow: 0 6px 20px rgba(74, 46, 31, 0.35);
}

.floating-btn.zalo {
    background: linear-gradient(135deg, #D4A679 0%, #B9845A 100%);
}

.floating-btn.zalo:hover {
    background: linear-gradient(135deg, #B9845A 0%, #9A6B45 100%);
}

.floating-btn.phone {
    background: linear-gradient(135deg, #C6935D 0%, #A06E45 100%);
}

.floating-btn.phone:hover {
    background: linear-gradient(135deg, #A06E45 0%, #8B5A3C 100%);
}

/* Desktop: show on right side */
@media (min-width: 768px) {
    .floating-contact {
        bottom: 6rem;
        right: 2rem;
    }
}

/* Mobile: adjust position */
@media (max-width: 767.98px) {
    .floating-contact {
        bottom: 5rem;
        right: 1rem;
    }

    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* ============================================
   VIEW COUNT STYLING
   ============================================ */

.view-count {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #B8AFA7;
    font-size: 0.85rem;
}

.view-count i {
    font-size: 0.9rem;
}

/* ============================================
   CATEGORY FILTER PILLS - ENHANCED
   ============================================ */

.luxe-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.luxe-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #FFFFFF;
    border: 2px solid #E3D0C3;
    border-radius: 30px;
    color: #5C4B42;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.luxe-filter-btn:hover,
.luxe-filter-btn.active {
    background: #8B5A3C;
    border-color: #8B5A3C;
    color: white;
}

.luxe-filter-btn .count {
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.luxe-filter-btn.active .count {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   SERVICES PAGE - CATEGORY TREE
   ============================================ */

.service-category-tree {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(74, 46, 31, 0.08);
}

.service-category-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.service-category-item:hover {
    background: #F0E6DC;
}

.service-category-item.active {
    background: #8B5A3C;
    color: white;
}

.service-subcategory {
    padding-left: 1.5rem;
    border-left: 2px solid #E3D0C3;
    margin-left: 0.5rem;
}

/* ============================================
   IMAGE GALLERY LIGHTBOX
   ============================================ */

.luxe-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.luxe-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.luxe-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.luxe-gallery-item:hover img {
    transform: scale(1.1);
}

.luxe-gallery-item::after {
    content: '\F52D';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.luxe-gallery-item:hover::after {
    opacity: 1;
}

/* ============================================
   CONTACT PAGE MAP
   ============================================ */

.map-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(74, 46, 31, 0.12);
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================
   404 PAGE
   ============================================ */

.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-page h1 {
    font-size: 8rem;
    font-weight: 700;
    color: #8B5A3C;
    line-height: 1;
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .error-page h1 {
        font-size: 5rem;
    }
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

@keyframes luxeFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #8B5A3C;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #8B5A3C;
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
