/* Helm Real Estate - Custom Styles */
/* Inspired by Helmship.com.au design */

:root {
    /* Color Palette */
    --primary-color: #2c5f7c;
    --secondary-color: #4a90a4;
    --accent-color: #8ab4c8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Neutral Colors */
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #dee2e6;
    
    /* Typography */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --container-max-width: 1200px;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-primary);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Performance Optimizations */
* {
    box-sizing: border-box;
}

.property-card,
.btn,
.form-control,
.form-select,
.nav-link {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Smooth scrolling for mobile */
@media (hover: none) and (pointer: coarse) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    .property-card:hover,
    .btn:hover,
    .nav-link:hover {
        transform: none !important;
    }
}

.container {
    max-width: var(--container-max-width);
}

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

/* Custom Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: background-color, border-color, transform;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1rem rgba(44, 95, 124, 0.2);
}

.text-primary {
    color: var(--primary-color) !important;
}

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

/* Navigation */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-family: var(--font-family-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.brand-text {
    margin-left: 0.5rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0.5rem 1rem !important;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after {
    left: 0;
    right: 0;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 95, 124, 0.1);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

.hero-compass {
    position: relative;
    z-index: 2;
}

.compass-icon {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(1);
    animation: float 6s ease-in-out infinite;
}

.compass-large {
    width: 200px;
    height: 200px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.hero-search-card {
    position: relative;
    z-index: 2;
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
}

/* Property Cards */
.property-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.property-card:hover {
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.property-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    backface-visibility: hidden;
}

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

.property-image-placeholder {
    height: 100%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.property-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

.property-badges .badge {
    margin-right: 0.5rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.property-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.property-actions .btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: var(--text-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, background;
}

.property-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.property-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    flex: 1;
}

.property-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.property-title a:hover {
    color: var(--primary-color);
}

.property-address {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.property-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.property-features .feature {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.property-features .feature i {
    margin-right: 0.25rem;
    color: var(--primary-color);
}

.property-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.property-footer {
    padding: 0 1.5rem 1.5rem;
}

/* Property Detail Page */
.property-detail-page .carousel-item img {
    height: 400px;
    object-fit: cover;
}

.property-hero-placeholder {
    height: 400px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    padding: 2rem 0;
    z-index: 2;
}

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.property-features-grid .feature-item {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.property-features-grid .feature-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.property-features-grid .feature-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.property-sidebar .agent-card,
.property-sidebar .contact-form-card,
.property-sidebar .property-summary {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-list li:last-child {
    border-bottom: none;
}

.map-placeholder {
    height: 400px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

/* Services Section */
.services-section {
    padding: 5rem 0;
}

.service-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--bg-white);
}

.service-icon i {
    font-size: 2rem;
}

/* Contact Page */
.contact-hero {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
}

.contact-item {
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
}

.contact-form-card .card {
    border-radius: var(--border-radius-lg);
}

/* Admin Panel */
.admin-page .nav-tabs .nav-link {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: 2px solid transparent;
}

.admin-page .nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-light) !important;
    border-color: var(--primary-color) var(--primary-color) var(--bg-white);
}

.admin-page .card {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.admin-page .card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    padding: 4rem 0;
}

/* Footer */
footer {
    background: var(--text-dark) !important;
}

.text-light-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-light-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.social-links a {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color) !important;
}

/* Google Maps Styling */
.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

#property-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

.map-placeholder {
    background: #f8f9fa;
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.gm-style-iw {
    border-radius: 8px;
}

.gm-style-iw-d {
    overflow: hidden !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .compass-large {
        width: 150px;
        height: 150px;
    }
    
    .property-features {
        justify-content: center;
    }
    
    .property-features-grid .row {
        justify-content: center;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Fix mobile layout issues */
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }
    
    .btn-group .btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .property-card .card-title {
        font-size: 1.1rem;
        line-height: 1.4;
        word-break: break-word;
        hyphens: auto;
    }
    
    .property-card .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
        word-break: break-word;
    }
    
    .property-features {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .feature-item {
        min-width: 0;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    
    /* Fix button groups on mobile */
    .btn-group-sm .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Table responsive */
    .table-responsive {
        font-size: 0.9rem;
    }
    
    /* Form improvements */
    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .form-control, .form-select {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

@media (max-width: 576px) {
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .hero-buttons .btn:last-child {
        margin-bottom: 0;
    }
    
    .property-card {
        margin-bottom: 2rem;
    }
    
    .property-features-grid .feature-item {
        margin-bottom: 1rem;
    }
    
    /* Better small screen layout */
    .container-fluid {
        padding: 0 10px;
    }
    
    .filters-sidebar {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .property-card .card-body {
        padding: 1rem;
    }
    
    .property-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .property-card .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .property-features {
        gap: 0.25rem;
    }
    
    .property-features .feature-item {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Fix navbar on small screens */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 0.5rem;
    }
    
    /* Property details responsive */
    .property-image img {
        width: 100%;
        height: auto;
    }
    
    .property-actions .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    /* Admin table improvements */
    .table td, .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        vertical-align: middle;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
    }
    
    /* Contact form responsive */
    .contact-form .btn {
        width: 100%;
        margin-top: 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Utility Classes */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.min-vh-100 {
    min-height: 100vh;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus States for Accessibility */
/* Form Controls */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-color: #fff;
}

.form-control:hover, .form-select:hover {
    border-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.05);
}

.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 124, 0.25);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    background-color: #fff;
}

/* Print Styles */
@media print {
    .navbar,
    .filters-sidebar,
    .property-actions,
    footer {
        display: none !important;
    }
    
    .property-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}
