/* Lanzone Immobiliare - Custom Styles */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --dark-overlay: rgba(0, 0, 0, 0.6);
    --navbar-height: 76px;
    --transition-base: 0.3s ease;
}

/* ===== Base Styles ===== */
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    padding-top: var(--navbar-height);
    line-height: 1.6;
    color: #333;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Navbar ===== */
.navbar {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.navbar .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

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

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

/* Fix pulsante Contatti nella navbar */
.navbar .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    transition: all var(--transition-base);
    font-weight: 500;
}

.navbar .btn-primary:hover,
.navbar .btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.navbar .btn-primary.text-white {
    color: #ffffff !important;
}

/* Mobile navbar */
@media (max-width: 991px) {
    .navbar .btn-primary {
        display: inline-block;
        margin-top: 10px;
        margin-bottom: 10px;
        width: auto;
    }
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(var(--dark-overlay), var(--dark-overlay)), 
                url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    background-size: cover;
    background-position: center;
    height: 80vh;
    min-height: 500px;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, transparent 50%);
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

.hero-section .lead {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-section .btn {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ===== Detail Hero ===== */
.detail-hero {
    margin-top: var(--navbar-height);
    position: relative;
}

.detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
}

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

.breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    display: inline-flex;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover,
.breadcrumb-item a:focus {
    color: white;
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 992px) {
    .detail-hero {
        margin-top: 0;
        height: 50vh;
        min-height: 300px;
    }
}

/* ===== Property Cards ===== */
.property-card {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: none;
    overflow: hidden;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

.property-img-wrapper {
    height: 250px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
}

.property-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.property-card:hover .property-img-wrapper img {
    transform: scale(1.08);
}

.badge-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 1;
}

.feature-icon {
    color: var(--success-color);
    width: 18px;
    text-align: center;
    margin-right: 8px;
    flex-shrink: 0;
}

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

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

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

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: all var(--transition-base);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: 8px;
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: 12px;
    transition: transform var(--transition-base);
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* ===== Sections ===== */
section {
    position: relative;
}

/* ===== Alerts ===== */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0c5883;
}

/* ===== Footer ===== */
footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

footer a {
    transition: color 0.2s ease;
}

footer a:hover,
footer a:focus {
    color: var(--primary-color) !important;
}

/* ===== Utilities ===== */
.text-primary {
    color: var(--primary-color) !important;
}

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

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

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

.animate-fade-in {
    animation: fadeIn 0.6s ease;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .hero-section {
        height: 70vh;
        min-height: 400px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .property-img-wrapper {
        height: 200px;
    }
    
    .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .btn,
    form,
    footer {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .hero-section {
        height: auto;
        min-height: auto;
        background: none !important;
        color: black !important;
    }
    
    .hero-section h1 {
        color: black !important;
        text-shadow: none;
    }
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    border-radius: 4px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    transition: opacity 0.2s;
}

.lightbox-nav:hover {
    opacity: 0.8;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Gallery images clickable */
.gallery-img {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Map container */
.map-container {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
}
