/*
|--------------------------------------------------------------------------
| Property Platform CSS - Mobile First Design
|--------------------------------------------------------------------------
| 
| CSS สำหรับระบบแพลตฟอร์มอสังหาริมทรัพย์
| มีสุข คอร์ปอเรชั่น (2006)
|
*/

/* ===================================================================
   BASE STYLES - Mobile First (< 576px)
   =================================================================== */

body {
    font-family: var(--theme-font-family);
    background-color: var(--theme-bg-body);
    color: var(--theme-text-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--theme-font-family-heading);
    color: var(--theme-text-heading);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--theme-primary-hover);
}

/* ===================================================================
   NAVBAR STYLES
   =================================================================== */

.navbar {
    background-color: var(--theme-bg-header) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
    height: 70px;
    transition: box-shadow 0.3s ease;
    will-change: box-shadow;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(26,83,25,0.15);
}

.navbar-brand {
    font-family: var(--theme-font-family-heading);
}

.brand-icon i {
    font-size: 1.75rem;
}

.brand-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--theme-primary);
    display: block;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.65rem;
    color: var(--theme-text-muted);
    display: block;
    line-height: 1;
}

.nav-link {
    color: var(--theme-text-body) !important;
    font-weight: 500;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid #eee;
    font-size: 0.9375rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--theme-primary) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: #D6EFD8;
    color: #1A5319;
}

.navbar-cta .btn {
    font-size: 0.8125rem;
}

/* Mobile menu background */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: #ffffff;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav {
        padding: 0.5rem 0;
    }
}

/* ===================================================================
   HERO SECTION
   =================================================================== */

.hero-property {
    background: linear-gradient(135deg, #508D4E 0%, #1A5319 100%);
    min-height: 500px;
    position: relative;
    padding-top: 1rem;
    padding-bottom: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/no-image.svg');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(80,141,78,0.92) 0%, rgba(26,83,25,0.88) 100%);
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 0.9375rem;
}

/* Hero Tabs */
.hero-tabs {
    margin-bottom: 1.5rem;
}

.btn-tab {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-tab:hover {
    background: rgba(128,175,129,0.4);
    border-color: #80AF81;
    color: white;
}

.btn-tab.active {
    background: #80AF81;
    border-color: #80AF81;
    color: #1A5319;
    font-weight: 600;
}

/* Search Box */
.search-box {
    border-radius: 16px;
    background: white;
}

.search-box .form-select,
.search-box .form-control {
    border-radius: 8px;
    border: 1px solid #D6EFD8;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.search-box .form-select:focus,
.search-box .form-control:focus {
    border-color: #508D4E;
    box-shadow: 0 0 0 3px rgba(80,141,78,0.15);
}

.search-box .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* Hero Stats */
.hero-stats .stat-number {
    font-family: var(--theme-font-family-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Hero Wave */
.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: 60px;
}

/* ===================================================================
   PROPERTY TYPES SECTION
   =================================================================== */

.property-types-section {
    padding: 3rem 0;
}

.property-type-card .card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.property-type-card:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle i {
    font-size: 1.25rem;
}

.type-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--theme-text-heading);
}

/* ===================================================================
   SECTION STYLES
   =================================================================== */

section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.875rem;
}

.bg-primary-light {
    background-color: var(--theme-primary-light) !important;
}

.bg-success-light {
    background-color: var(--theme-success-light) !important;
}

.bg-warning-light {
    background-color: var(--theme-warning-light) !important;
}

.bg-info-light {
    background-color: var(--theme-info-light) !important;
}

.bg-danger-light {
    background-color: var(--theme-danger-light) !important;
}

/* ===================================================================
   PROPERTY CARD
   =================================================================== */

.property-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.property-image {
    position: relative;
    padding-top: 70%;
    overflow: hidden;
}

.property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.property-badges .badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.375rem 0.5rem;
}

.btn-favorite {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.3s ease;
}

.btn-favorite:hover,
.btn-favorite.active {
    background: #ef4444;
    color: white;
}

.property-type-label .badge {
    font-size: 0.625rem;
}

.property-price {
    font-size: 1rem;
    font-family: var(--theme-font-family-heading);
}

.property-title a {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.property-location {
    font-size: 0.75rem;
}

.property-features {
    font-size: 0.6875rem;
}

.property-features span {
    display: inline-flex;
    align-items: center;
}

/* Listing Filter Tabs */
.btn-filter {
    background: #D6EFD8;
    border: none;
    color: #1A5319;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.btn-filter:hover {
    background: #80AF81;
    color: #1A5319;
}

.btn-filter.active {
    background: #508D4E;
    color: white;
}

/* ===================================================================
   CTA SECTION
   =================================================================== */

.cta-box {
    background: linear-gradient(135deg, #508D4E 0%, #1A5319 100%);
    position: relative;
}

.cta-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.cta-title {
    font-size: 1.5rem;
}

.cta-subtitle {
    font-size: 0.9375rem;
}

.cta-feature {
    font-size: 0.875rem;
}

.cta-image {
    max-height: 250px;
}

/* ===================================================================
   ABOUT SECTION
   =================================================================== */

.about-image {
    max-height: 280px;
}

.about-features {
    font-size: 0.875rem;
}

.about-stats .stat-item {
    padding: 0 1rem;
    border-right: 1px solid #e5e7eb;
}

.about-stats .stat-item:last-child {
    border-right: none;
}

/* ===================================================================
   CONTACT SECTION
   =================================================================== */

.contact-card .icon-box {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.contact-form .form-control,
.contact-form .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* ===================================================================
   FOOTER SECTION
   =================================================================== */

.footer {
    background-color: var(--theme-bg-footer);
    color: rgba(255,255,255,0.75);
}

.footer-title {
    font-size: 0.9375rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: #80AF81;
}

.footer-link {
    color: rgba(214,239,216,0.8);
    font-size: 0.8125rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #80AF81;
    padding-left: 5px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(128,175,129,0.2);
    border-radius: 50%;
    color: #80AF81;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #80AF81;
    color: #1A5319;
    transform: translateY(-3px);
}

.footer-bottom {
    border-color: rgba(255,255,255,0.1) !important;
}

/* Back to Top Button */
.btn-back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(80,141,78,0.3);
}

.btn-back-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   BUTTON STYLES
   =================================================================== */

.btn {
    font-family: var(--theme-font-family);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-primary:hover {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-secondary {
    background-color: var(--theme-secondary);
    border-color: var(--theme-secondary);
}

.btn-secondary:hover {
    background-color: var(--theme-secondary-hover);
    border-color: var(--theme-secondary-hover);
}

.btn-light {
    background-color: white;
    border-color: white;
    color: var(--theme-primary);
}

.btn-light:hover {
    background-color: #f1f5f9;
    border-color: #f1f5f9;
    color: var(--theme-primary-hover);
}

/* ===================================================================
   CARD STYLES
   =================================================================== */

.card {
    background-color: var(--theme-bg-card);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.text-primary { color: var(--theme-primary) !important; }
.text-secondary { color: var(--theme-secondary) !important; }
.text-success { color: var(--theme-success) !important; }
.text-warning { color: var(--theme-warning) !important; }
.text-danger { color: var(--theme-danger) !important; }
.text-info { color: var(--theme-info) !important; }

/* ===================================================================
   RESPONSIVE: TABLET (>= 576px)
   =================================================================== */

@media (min-width: 576px) {
    body {
        font-size: 15px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn-tab {
        padding: 0.75rem 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
    }
    
    .icon-circle i {
        font-size: 1.5rem;
    }
    
    .type-name {
        font-size: 0.9375rem;
    }
    
    .property-price {
        font-size: 1.125rem;
    }
    
    .property-title a {
        font-size: 0.875rem;
    }
    
    .property-features {
        font-size: 0.75rem;
    }
}

/* ===================================================================
   RESPONSIVE: TABLET LANDSCAPE (>= 768px)
   =================================================================== */

@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .hero-property {
        min-height: 550px;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-stats .stat-number {
        font-size: 2rem;
    }
    
    .hero-wave svg {
        height: 80px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    .about-image {
        max-height: 350px;
    }
}

/* ===================================================================
   RESPONSIVE: DESKTOP (>= 992px)
   =================================================================== */

@media (min-width: 992px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem !important;
        border-bottom: none;
    }
    
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--theme-primary);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }
    
    .nav-item {
        position: relative;
    }
    
    .nav-link:hover::after,
    .nav-link.active::after {
        width: 80%;
    }
    
    section {
        padding: 5rem 0;
    }
    
    .hero-property {
        min-height: 600px;
        padding-top: 2rem;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .search-box .card-body {
        padding: 1.5rem 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .icon-circle {
        width: 70px;
        height: 70px;
    }
    
    .icon-circle i {
        font-size: 1.75rem;
    }
    
    .property-card .card-body {
        padding: 1rem 1.25rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-image {
        max-height: 300px;
    }
    
    .about-image {
        max-height: 400px;
    }
}

/* ===================================================================
   RESPONSIVE: LARGE DESKTOP (>= 1200px)
   =================================================================== */

@media (min-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .hero-stats .stat-number {
        font-size: 2.5rem;
    }
}

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

@media print {
    .navbar,
    .footer,
    .btn-back-to-top,
    .hero-property,
    .cta-section {
        display: none !important;
    }
}

/* ===================================================================
   REDUCED MOTION
   =================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================================================
   GLOBAL FORM CONTROLS — Rounded inputs (matching admin style)
   Keeps original system colors; only overrides border-radius.
   =================================================================== */
.form-control,
.form-select,
textarea.form-control {
    border-radius: 10px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary, #086337);
    box-shadow: 0 0 0 3px rgba(8, 99, 55, 0.12);
    outline: none;
}

/* Input groups: keep left/right radius only on edge children */
.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-radius: 10px 0 0 10px !important;
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-radius: 0 10px 10px 0 !important;
}
.input-group > .input-group-text:first-child {
    border-radius: 10px 0 0 10px !important;
}
.input-group > .input-group-text:last-child {
    border-radius: 0 10px 10px 0 !important;
}
/* Only child in input-group stays fully rounded */
.input-group > .form-control:only-child {
    border-radius: 10px !important;
}

