/* Reset some defaults */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Unit Card Styles - Desktop/Large Screens */
.unit-image,
.unit-image-placeholder {
    width: 100%;
    height: 160px !important;
    overflow: hidden;
    position: relative;
}

.unit-image img,
.unit-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Body */
body {
    background: #e3f2fd;
    color: #1f2937;
    line-height: 1.6;
    padding: 0;
    min-height: 100vh;
}

/* Header — visual overrides live in base.html inline <style>;
   keep only fallback color here, no margin/transform that
   would break sticky positioning. */
header {
    background-color: #4f46e5;
    color: white;
    padding: 15px 20px;
    margin-bottom: 0;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}

body {
    padding-top: 60px !important;
}

header h1 {
    font-size: 24px;
}

/* Navigation links — only for main-nav inside header */
header .main-nav a {
    color: white;
    text-decoration: none;
}

header .main-nav a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    width: 100%;
    margin: 0;
    padding: 20px;
    background-color: transparent;
    border-radius: 10px;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}

/* Buttons — only for legacy un-classed buttons */
button:not([class]),
input[type="submit"]:not([class]) {
    background-color: #4f46e5;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:not([class]):hover,
input[type="submit"]:not([class]):hover {
    background-color: #3730a3;
}

/* Links — only plain/un-classed anchors get the accent color.
   Styled links (.ps-btn, .td-btn, .nav-link, etc.) keep their
   own component colours. */
a:not([class]) {
    color: #4f46e5;
    text-decoration: none;
}

a:not([class]):hover {
    text-decoration: underline;
}

/* Lazy loading images */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Forms — scoped to .container for legacy pages */
.container form input,
.container form select,
.container form textarea {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Lists — reset list-style globally; borders only for legacy .container */
ul {
    list-style: none;
    margin-bottom: 20px;
}

.container li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* Modal (reusable) */
.modal-card {
    background: white;
    max-width: 420px;
    margin: 16px auto;
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(16,24,40,0.15);
}
.modal-row { margin: 8px 0; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.btn-link { background:transparent; color:#374151; border:none; cursor:pointer; padding:8px 12px; }
.modal-result { margin-top:8px; color: #065f46; }

/* Overlay handled inline via display:flex on parent - keep minimal here */

/* Modal overlay */
#booking-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    visibility: hidden;
    opacity: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
}

/* animate modal opening */
#booking-modal.open { visibility: visible; opacity: 1; transition: opacity 180ms ease; }
.modal-card { transform: translateY(12px); opacity: 0; transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 180ms ease; }
#booking-modal.open .modal-card { transform: translateY(0); opacity: 1; }

/* toast animation */
.site-toast { opacity: 0; transform: translateY(10px); transition: opacity 220ms ease, transform 220ms ease; }
.site-toast.show { opacity: 1; transform: translateY(0); }

/* Closing animation state for modal */
#booking-modal.closing { opacity: 0; transition: opacity 180ms ease; }
#booking-modal.closing .modal-card { transform: translateY(12px); opacity: 0; }

/* Toast hide state */
.site-toast.hide { opacity: 0; transform: translateY(10px); }

/* Toast */
.site-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: rgba(31,41,55,0.95);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 320px;
}

/* Enhanced Dropdown Styles for Property Management */
.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
    transform: translateX(5px);
}

.dropdown-item-empty {
    display: block;
    padding: 12px 20px;
    color: #999;
    font-style: italic;
    cursor: default;
}

.dropdown-item-action {
    display: block;
    padding: 12px 20px;
    color: #28a745;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    font-weight: 600;
}

.dropdown-item-action:hover {
    background-color: #28a745;
    color: white;
    transform: translateX(5px);
}

.dropdown-item-highlight {
    display: block;
    padding: 12px 20px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    font-weight: 700;
    background-color: #e3f2fd;
    border-left: 4px solid #007bff;
}

.dropdown-item-highlight:hover {
    background-color: #007bff;
    color: white;
    transform: translateX(5px);
}

.dropdown-item-help {
    display: block;
    padding: 8px 20px 12px 20px;
    color: #666;
    font-size: 0.85em;
    cursor: default;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.dropdown-item-subtitle {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 4px 0;
}

/* Add Property Button Animation */
.dropdown-item-action::before {
    content: "➕";
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.dropdown-item-action:hover::before {
    transform: rotate(90deg);
}

/* First Property Button Special Styling */
.dropdown-item-highlight::before {
    content: "🏠";
    margin-right: 8px;
    font-size: 1.1em;
}

/* Property Mini-Buttons in Dropdown */
.dropdown-property-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.dropdown-property-btn:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #007bff;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.dropdown-property-btn .property-icon {
    font-size: 16px;
    margin-right: 8px;
}

.dropdown-property-btn .property-info {
    flex: 1;
}

.dropdown-property-btn .property-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    display: block;
}

.dropdown-property-btn .property-location {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    display: block;
}

/* First Property Indicator for Main Button */
#main-properties-btn {
    position: relative;
}

.first-property-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   DROPDOWN MENU STYLES - DESKTOP/LAPTOP
   ======================================== */

/* Navigation Dropdown Container */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Menu - Desktop positioning */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    max-width: 320px;
    z-index: 99999;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
}

/* Show dropdown when active */
.dropdown-menu.show {
    display: block;
}

/* Dropdown Items - Ensure visibility */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #667eea;
}

/* Dropdown Icon */
.dropdown-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Dropdown Toggle Button */
.dropdown-toggle {
    background: none;
    border: none;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}