/* Components CSS - Propland Realtor Theme */
/* This file should be saved as: css/components.css */

/* Logo Styles */
.logo {
    display: flex !important;
    align-items: center;
    gap: 0;
    margin-bottom: 0.5rem;
}

.logo img {
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
}

.logo-foot img {
    height: 40px;
    transition: var(--transition);
    margin-top: 0.5rem;
}
.logo-foot:hover img {
    transform: scale(1.05);
}

/* Enhanced Property Cards */
.property-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(239, 90, 82, 0.2);
}

/* Enhanced Search Form */
.search-form {
    background: #ffffff5c;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(239, 90, 82, 0.1);
    position: relative;
    overflow: hidden;
}

.search-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

.btn {
    position: relative;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 3rem; 
    white-space: nowrap; 
    box-sizing: border-box; 
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
    gap: 0.5rem; 
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    min-height: 2.5rem; /* ✅ เพิ่ม */
}

/* ✅ Loading State - เพิ่มใหม่ทั้งหมด */
.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    width: 100%;
    position: relative;
    z-index: 2;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    color: inherit;
    z-index: 3;
}

.loading i {
    font-size: 1.2rem;
    animation: loadingSpin 1s linear infinite;
}

/* ✅ Loading State Classes */
.btn.is-loading {
    pointer-events: none;
    cursor: not-allowed;
}

.btn.is-loading .btn-text {
    opacity: 0;
    visibility: hidden;
}

.btn.is-loading .loading {
    display: block;
}

/* ✅ Loading Enhancement - รวมกับ hover effects */
.btn.is-loading::before {
    display: none; /* ปิด hover effect ตอน loading */
}

.btn.is-loading:hover {
    transform: none; /* ปิด hover transform ตอน loading */
}

/* ✅ Spinner Animation */
@keyframes loadingSpin {
    from { 
        transform: translate(-50%, -50%) rotate(0deg); 
    }
    to { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

/* ✅ Auth Forms - ปุ่มขนาดใหญ่ */
.auth-card .btn {
    min-height: 3.25rem; /* 52px */
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 2rem;
}

/* ✅ OTP และ Phone buttons */
#verifyOtpBtn,
.btn-phone {
    min-height: 3.25rem;
    width: 100%;
}

/* ✅ Social Login Buttons */
.btn-google,
.btn-facebook,
.btn-apple {
    min-height: 3.25rem;
}

/* Stats Section with new gradient */
.stats {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="30" cy="30" r="2"/></g></svg>');
    opacity: 0.3;
}

.stats .container {
    position: relative;
    z-index: 1;
}

/* Contact Form Enhancement */
.contact-form {
    background: var(--background);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 2px solid rgba(239, 90, 82, 0.1);
    position: relative;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(239, 90, 82, 0.1);
}

/* Enhanced Contact Items */
.contact-item i {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 4px 8px rgba(239, 90, 82, 0.3);
}

/* Feature Icons */
.feature i {
    color: #00000090;
    background: rgb(255, 255, 255);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Social Links Enhancement */
.social-links a {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: var(--transition);
}

.social-links a:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 12px rgba(239, 90, 82, 0.4);
}

/* Loading Animation */
.loading {
    color: var(--primary-color);
}

.loading i {
    color: var(--primary-color);
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.no-results i {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Notification Styles */
.notification {
    border-left-color: var(--primary-color) !important;
    border-width: 4px;
}

.notification-success {
    border-left-color: var(--secondary-color) !important;
    background: rgba(255, 215, 0, 0.05);
}

.notification-error {
    border-left-color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.05);
}

/* Hero Section Enhancement */
.hero-content h1 {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Property Actions */
.property-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ✅ Enhanced Image Hover - ปรับให้ไม่ซ้ำกับ style.css */
.property-image {
    position: relative;
    overflow: hidden;
}

/* ลบ .property-image::after เนื่องจากมีใน style.css แล้ว */

/* ✅ Price highlighting - ปรับให้ไม่ซ้ำกับ style.css */
/* ลบ .property-price เนื่องจากมีใน style.css แล้ว */

/* Section Headers Enhancement */
.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Mobile Menu Enhancements */
.mobile-menu-toggle {
    position: relative;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle i {
    transition: var(--transition);
}

/* Mobile Navigation Links Hover Effects */
.mobile-nav-links a {
    position: relative;
    overflow: hidden;
}

.mobile-nav-links a::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.mobile-nav-links a:hover::before {
    left: 0;
}

/* Mobile Auth Buttons Enhancement */
.mobile-auth-buttons .btn {
    position: relative;
    overflow: hidden;
    min-height: 3rem; /* ✅ เพิ่ม */
}

.mobile-auth-buttons .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mobile-auth-buttons .btn:hover::after {
    width: 300px;
    height: 300px;
}

/* ✅ Loading State สำหรับ mobile auth buttons */
.mobile-auth-buttons .btn.is-loading::after {
    display: none; /* ปิด ripple effect ตอน loading */
}

/* Backdrop Blur Effect for Modern Browsers */
@supports (backdrop-filter: blur(10px)) {
    .mobile-menu {
        backdrop-filter: blur(10px);
        background: rgba(0, 0, 0, 0.3);
    }
}

/* ✅ Responsive Loading Buttons */
@media (max-width: 768px) {
    .btn {
        min-height: 2.75rem; /* 44px สำหรับ mobile */
        font-size: 0.9rem;
    }
    
    .auth-card .btn {
        min-height: 3rem; /* 48px สำหรับ auth forms ใน mobile */
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .loading i {
        font-size: 1rem; /* ลด spinner ใน mobile */
    }
    
    .search-form {
        padding: 1.5rem;
    }
    
    .property-actions {
        flex-direction: column;
    }
    
    .property-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Menu Responsive Adjustments */
    .mobile-menu-content {
        max-width: 280px;
        padding: 100px 1.5rem 1.5rem;
    }
    
    .mobile-nav-links a {
        font-size: 1rem;
        padding: 0.875rem 0;
    }
    
    .mobile-auth-buttons .btn {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .btn {
        min-height: 2.5rem; /* 40px สำหรับ mobile เล็ก */
        font-size: 0.85rem;
    }
    
    .auth-card .btn {
        min-height: 2.75rem; /* 44px */
        padding: 0.75rem 1.25rem;
    }
    
    .loading i {
        font-size: 0.9rem;
    }
    
    .mobile-menu-content {
        max-width: 100%;
        padding: 90px 1rem 1rem;
    }
    
    .mobile-nav-links a {
        font-size: 0.9rem;
        padding: 0.75rem 0;
    }
    
    .mobile-auth-buttons {
        gap: 0.75rem;
    }
    
    .mobile-auth-buttons .btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

.animate-slide-right {
    animation: slideRight 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideRight {
    from { 
        opacity: 0; 
        transform: translateX(-30px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Mobile Menu Animation Keyframes */
@keyframes mobileMenuSlide {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Pulse Animation for Mobile Toggle */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 90, 82, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 90, 82, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 90, 82, 0);
    }
}

.mobile-menu-toggle.active {
    animation: pulse 2s infinite;
}