/* Google Maps Aesthetic & Bright Sunny Theme */
:root {
    --text-main: #202124;
    --text-muted: #70757a;
    --gm-blue: #1a73e8;
    --gm-bg: #ffffff;
    --lens-bg: rgba(255, 255, 255, 0.6);
    --lens-border: rgba(255, 255, 255, 0.8);
    --lens-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%; height: 100%;
    overflow: hidden;
    background-color: #f1f3f4;
}

/* Background */
.background-marina {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(to bottom, #87CEEB 0%, #e0f7fa 100%);
    filter: blur(5px) brightness(1.1);
    transform: scale(1.05);
    z-index: -1;
}

.app-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-bottom: 120px;
}

/* Header */
.header-bar {
    padding: 20px 20px 10px 20px;
    text-align: center;
    position: relative;
}

.header-bar h1 {
    font-size: 1.8rem; font-weight: 500; color: var(--text-main);
    text-shadow: 0 2px 10px rgba(255,255,255,0.9);
}

.header-bar p {
    font-size: 0.9rem; color: #5f6368; font-weight: 500;
}

/* Google Maps Photo Carousel */
.photo-carousel {
    width: 100%;
    padding: 10px 0 20px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
}
.photo-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.carousel-track {
    display: flex;
    gap: 12px;
    padding-right: 15px; /* Slight padding for the last item */
    width: max-content;
}

.carousel-item {
    width: 280px; height: 190px;
    border-radius: 24px; /* Match glass-panel border radius */
    background-color: #e8eaed;
    scroll-snap-align: start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Slightly softer shadow */
    display: flex; align-items: flex-end; padding: 15px;
}

/* Real property photos */
.photo-1 { background-image: url('../images/photo1.jpg?v=2'); background-size: cover; background-position: center; }
.photo-2 { background-image: url('../images/photo2.jpg?v=2'); background-size: cover; background-position: center; }
.photo-3 { background-image: url('../images/photo3.jpg?v=2'); background-size: cover; background-position: center; }
.photo-4 { background-image: url('../images/photo4.jpg?v=2'); background-size: cover; background-position: center; }
.photo-5 { background-image: url('../images/photo5.jpg?v=2'); background-size: cover; background-position: center; }

/* Central Calendar Pillar */
.calendar-pillar {
    width: 100%; max-width: 500px; /* Central Pillar Constraint */
    margin: 0 auto;
    padding: 0 15px;
    display: flex; flex-direction: column;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.calendar-panel {
    padding: 20px;
    display: flex; flex-direction: column;
}

.calendar-header-fixed {
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.calendar-header-fixed h2 {
    font-size: 1.3rem; font-weight: 500; color: var(--text-main); margin-bottom: 15px; text-align: center;
}

.weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
}

.calendar-scroll-area {
    display: flex; flex-direction: column; gap: 20px;
}

.month-block {
    display: flex; flex-direction: column; gap: 10px;
}

.month-title {
    font-size: 1rem; font-weight: 500; color: var(--text-main); padding-left: 5px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px; /* Classic calendar grid gaps */
}

/* The Lenses */
.empty-slot {
    aspect-ratio: 1;
}

.day-lens {
    position: relative;
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    perspective: 500px; /* For 3D press effect */
}

.analog-text {
    position: absolute;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #111;
    z-index: 1;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
    font-family: 'Courier New', Courier, monospace; /* Mechanical aesthetic */
}

.date-num { font-size: 1.15rem; font-weight: 800; }
.price-tag { font-size: 0.65rem; font-weight: 700; margin-top: 2px;}

.glass-lens {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    z-index: 2;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 80%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 
        inset 0 4px 6px rgba(255,255,255,0.8), 
        inset 0 -4px 6px rgba(0,0,0,0.15),
        0 8px 15px rgba(0,0,0,0.15); /* thick glass shadow */
    
    /* Concave Magnifying Lens Effect - Crisp optics, no blur */
    backdrop-filter: contrast(1.3) brightness(1.1);
    -webkit-backdrop-filter: contrast(1.3) brightness(1.1);
    
    transform: translateZ(20px); /* Extrude out towards viewer */
    transition: transform 0.1s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.1s, background 0.2s;
}

.day-lens:active .glass-lens { 
    transform: translateZ(2px); /* Bottoming out / sticky press */
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.6), 
        inset 0 -2px 4px rgba(0,0,0,0.1),
        0 2px 5px rgba(0,0,0,0.1);
}

.day-lens.selected .glass-lens, .day-lens.in-range .glass-lens {
    background: rgba(26, 115, 232, 0.15);
    border-color: rgba(26, 115, 232, 0.8);
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.8), inset 0 0 15px rgba(26, 115, 232, 0.6);
}
.day-lens.selected .analog-text, .day-lens.in-range .analog-text { color: #1a73e8; } /* Tint text for selected */

.day-lens.in-range {
    /* Sharp glass connection between dates */
}
.day-lens.in-range::before {
    content: '';
    position: absolute;
    top: 50%; left: -10px; right: -10px; height: 60%;
    transform: translateY(-50%);
    background: rgba(26, 115, 232, 0.1);
    border-top: 1px solid rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.5);
    z-index: 0;
}

/* Unavailable (Empty, non-clickable, neon glow) */
.day-lens.booked { cursor: not-allowed; }
.day-lens.booked .analog-text { display: none; /* No text, empty */ }
.day-lens.booked .glass-lens {
    transform: translateZ(0px); /* Depressed */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.day-lens.status-locked .glass-lens {
    background: radial-gradient(circle at center, rgba(128,0,128,0.7) 0%, rgba(128,0,128,0.1) 80%);
    border-color: rgba(128,0,128,0.5);
}
.day-lens.status-confirmed .glass-lens {
    background: radial-gradient(circle at center, rgba(220,38,38,0.7) 0%, rgba(220,38,38,0.1) 80%);
    border-color: rgba(220,38,38,0.5);
}
.day-lens.status-sanitary .glass-lens {
    background: radial-gradient(circle at center, rgba(59,130,246,0.7) 0%, rgba(59,130,246,0.1) 80%);
    border-color: rgba(59,130,246,0.5);
}
.day-lens.status-sanitary-assigned .glass-lens {
    background: repeating-linear-gradient(
        45deg,
        rgba(59, 130, 246, 0.2),
        rgba(59, 130, 246, 0.2) 8px,
        rgba(59, 130, 246, 0.45) 8px,
        rgba(59, 130, 246, 0.45) 16px
    );
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: inset 0 2px 5px rgba(255,255,255,0.8), inset 0 0 15px rgba(59, 130, 246, 0.5);
}
.day-lens.status-late-booking .glass-lens {
    background: radial-gradient(circle at center, rgba(132,204,22,0.6) 0%, rgba(132,204,22,0.1) 80%);
    border: 2px solid rgba(132,204,22,0.8);
}

/* Calculator Panel (Bottom Sheet style) */
.calculator-panel {
    position: fixed;
    bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 92%; max-width: 500px;
    padding: 15px 20px;
    display: flex; flex-direction: column; gap: 15px;
    z-index: 100;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp { from { transform: translate(-50%, 100px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.calc-info { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.calc-dates { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.calc-price { font-size: 1.5rem; font-weight: 500; color: var(--text-main); }

.calc-actions { display: flex; gap: 10px; }

.gm-select, .gm-btn {
    border-radius: 20px; font-size: 0.95rem; font-weight: 500; padding: 10px 15px;
    border: 1px solid #dadce0; outline: none; background: white;
}
.gm-select { flex: 1; color: var(--text-main); }
.gm-btn { flex: 2; background: var(--gm-blue); color: white; border: none; box-shadow: 0 2px 6px rgba(26,115,232,0.4); cursor: pointer; }

/* Butler */
.butler-widget {
    position: fixed;
    top: 310px;
    right: calc(50% - 250px - 15px);
    z-index: 200;
}

.butler-icon {
    width: 50px; height: 50px;
    background: linear-gradient(135deg, #fcfcfc 0%, #e8e8e8 100%);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    border: 1px solid #dadce0;
    transition: all 0.3s ease;
}
.butler-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.butler-icon img { width: 28px; }

.butler-chat {
    position: absolute;
    top: -150px; /* Align vertically centered: 25px button center minus 175px half height */
    right: 65px; /* 15px gap to the left of the 50px wide button */
    width: 280px;
    height: 350px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: right center;
    animation: scaleInRight 0.2s ease-out;
}

@keyframes scaleInRight {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 500px) {
    .butler-widget {
        right: 10px;
        top: 310px;
    }
    .butler-chat {
        right: 55px; /* 5px gap on mobile */
        width: calc(100vw - 75px);
        max-width: 280px;
        top: -150px;
    }
}

.chat-header { padding: 15px; background: #f8f9fa; border-bottom: 1px solid #dadce0; display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: white;}
.msg { padding: 10px 14px; border-radius: 16px; font-size: 0.85rem; max-width: 85%; line-height: 1.4; }
.butler-msg { background: #f1f3f4; color: var(--text-main); align-self: flex-start; border-bottom-left-radius: 4px; }
.user-msg { background: var(--gm-blue); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { padding: 10px; display: flex; gap: 8px; background: #f8f9fa; border-top: 1px solid #dadce0; }
.chat-input input { flex: 1; padding: 10px 15px; border-radius: 20px; border: 1px solid #dadce0; outline: none; font-size: 0.85rem; }
.chat-input button { background: var(--gm-blue); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
