/* ===================================
   MODAL STYLES - ENHANCED
   Property Details, Reservation, List Property & Lightbox
   ================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-color);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.property-modal-content {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
    font-size: 28px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-color);
}

/* ===================================
   PROPERTY MODAL STYLES
   ================================== */

.property-modal-body {
    padding: 0;
}

.property-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.carousel-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel-image-container img:hover {
    transform: scale(1.02);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-btn svg {
    color: var(--primary-color);
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: white;
    width: 30px;
    border-radius: 5px;
}

.property-modal-details {
    padding: 30px;
}

.property-modal-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.property-modal-location svg {
    width: 18px;
    height: 18px;
}

.property-modal-price {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

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

.property-modal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.property-modal-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.property-modal-features svg {
    color: var(--primary-color);
}

.property-modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.property-modal-actions .btn {
    flex: 1;
    min-width: 200px;
}

/* === Security Deposit row (light + dark mode) === */
.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 16px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.98rem;
}

.modal-meta-row span {
  color: var(--text-color);
  font-weight: 600;
}

.modal-meta-row strong {
  color: var(--primary-color);
  font-weight: 700;
}

/* Dark theme contrast */
[data-theme="dark"] .modal-meta-row {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .modal-meta-row span {
  color: #cbd5e1;
}

[data-theme="dark"] .modal-meta-row strong {
  color: #fbbf24;
}

/* ===================================
   LIGHTBOX MODAL STYLES
   ================================== */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease-out;
}

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

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 48px;
    color: white;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-btn.prev {
    left: 40px;
}

.lightbox-btn.next {
    right: 40px;
}

.lightbox-btn svg {
    color: white;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
}

/* ===================================
   RESERVATION FORM STYLES
   ================================== */

.reservation-form {
    padding: 30px;
}

.property-display {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 84, 144, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Fix for white dots in dark mode dropdowns */
[data-theme="dark"] .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23cbd5e1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    color-scheme: dark;
}

.form-group input[type="date"] {
    cursor: pointer;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===================================
   BOOKING SUMMARY STYLES
   ================================== */

.booking-summary {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin: 10px 0;
    border: 2px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 16px;
    color: var(--text-color);
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 15px;
    margin-top: 10px;
    border-top: 2px solid var(--primary-color);
}

.summary-row.total span:last-child {
    color: var(--accent-color);
}

/* ===================================
   MODAL ACTION BUTTONS
   ================================== */

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

/* FIX: New button style for "Book & Pay Later" with better contrast */
.btn-secondary-alt {
    background: var(--text-color);
    color: var(--bg-color);
    border: 2px solid var(--text-color);
}

.btn-secondary-alt:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .btn-secondary-alt {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

[data-theme="dark"] .btn-secondary-alt:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.btn svg {
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
}

/* ===================================
   PROPERTY CARD BADGES
   ================================== */

.property-badge.short-stay {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.property-badge.for-sale {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.property-badge.for-rent {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.property-badge.investment {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

/* ===================================
   NOTIFICATION STYLES
   ================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease-out;
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-success {
    border-left: 4px solid #27ae60;
}

.notification-success svg {
    color: #27ae60;
}

.notification-error {
    border-left: 4px solid #e74c3c;
}

.notification-error svg {
    color: #e74c3c;
}

.notification-info {
    border-left: 4px solid #3498db;
}

.notification-info svg {
    color: #3498db;
}

.notification-content span {
    flex: 1;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

/* ===================================
   LOADING STATE
   ================================== */

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   DARK MODE ADJUSTMENTS
   ================================== */

[data-theme="dark"] .modal-content {
    background: #1e293b;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-header h2 {
    color: #60a5fa;
}

[data-theme="dark"] .property-display {
    background: rgba(198, 158, 92, 0.1);
    color: #fbbf24;
    border-left-color: #fbbf24;
}

[data-theme="dark"] .booking-summary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .summary-row {
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .summary-row.total {
    color: #60a5fa;
    border-top-color: #60a5fa;
}

[data-theme="dark"] .summary-row.total span:last-child {
    color: #fbbf24;
}

[data-theme="dark"] .notification {
    background: #1e293b;
}

[data-theme="dark"] .notification-content span {
    color: #cbd5e1;
}

[data-theme="dark"] .carousel-btn {
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .carousel-btn:hover {
    background: #1e293b;
}

/* ===================================
   SCROLLBAR STYLING
   ================================== */

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb {
    background: #fbbf24;
}

/* ===================================
   RESPONSIVE MODAL STYLES
   ================================== */

@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 24px;
    }
    
    .reservation-form {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .booking-summary {
        padding: 15px;
    }
    
    .summary-row {
        font-size: 14px;
    }
    
    .summary-row.total {
        font-size: 18px;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .property-carousel {
        height: 300px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn.prev {
        left: 10px;
    }
    
    .carousel-btn.next {
        right: 10px;
    }
    
    .property-modal-details {
        padding: 20px;
    }
    
    .property-modal-actions {
        flex-direction: column;
    }
    
    .property-modal-actions .btn {
        min-width: auto;
        width: 100%;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 36px;
    }
    
    .lightbox-btn {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-btn.prev {
        left: 15px;
    }
    
    .lightbox-btn.next {
        right: 15px;
    }
}

#termsModal .modal-body {
    padding: 16px;
}

/* Split form group for horizontal field pairing */
.form-group-split {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.form-split-item {
    display: flex;
    flex-direction: column;
}

.form-split-item label {
    margin-bottom: 5px;
}

.form-split-item input {
    width: 100%;
}
