/* Calidum Apartments - Main Stylesheet */

/* Font and Base Styles */
body {
    font-family: 'Poppins', sans-serif;
}

/* Hero Section */
.hero-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    position: relative;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('hero-desktop.jpeg') center center / cover no-repeat;
    pointer-events: none;
}

/* Card Shadows and Hover Effects */
.card-shadow {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Carousel Styles */
.carousel {
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.slide {
    display: none;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    display: block;
}

.carousel button {
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.carousel button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Calendar Styles */
.availability-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    min-height: 50px;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.day-cell.available {
    background-color: #10b981;
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.day-cell.unavailable {
    background-color: #ef4444;
    color: white;
    cursor: not-allowed;
    opacity: 0.8;
}

.day-cell.selected {
    background-color: #3b82f6;
    color: white;
    border-color: #1d4ed8;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.day-cell.available:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.day-cell .price {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 2px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-header-day {
    text-align: center;
    font-weight: 600;
    padding: 8px 4px;
    background-color: #f3f4f6;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
}

/* Language Picker */
.language-picker {
    position: relative;
    display: inline-block;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 120px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.language-option:first-child {
    border-radius: 8px 8px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 8px 8px;
}

.flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
}

/* Gallery Modal Styles */
.gallery-modal {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.gallery-modal img {
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Styles */
.modal {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    animation: scaleIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Gallery Modal Carousel Styles */
.modal-carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.modal-carousel img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.prev {
    left: 20px;
}

.modal-nav-btn.next {
    right: 20px;
}

.modal-image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

/* Apartment Modal Styles */
.apartment-modal {
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
}

/* Enhanced Amenity Icons */
.amenity-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Form Styling */
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Button Animations */
button,
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
}

button:active,
.btn:active {
    transform: translateY(0);
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Better Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Prevent Horizontal Scroll */
* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
    scroll-behavior: smooth;
}

.max-w-7xl {
    max-width: min(80rem, 100vw);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-bg::before {
        background: url('hero-mobile.jpeg') center center / cover no-repeat;
    }

    .hero-bg {
        background-attachment: scroll;
        padding: 60px 0 40px;
    }

    .hero-bg h1 {
        font-size: 2.5rem;
    }

    .hero-bg p {
        font-size: 1.125rem;
    }

    .availability-calendar {
        font-size: 12px;
        gap: 3px;
    }

    .day-cell {
        min-height: 42px;
        font-size: 12px;
        border-radius: 6px;
    }

    .day-cell .price {
        font-size: 11px;
        margin-top: 1px;
    }

    .calendar-header-day {
        padding: 6px 2px;
        font-size: 12px;
    }

    .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .py-32 {
        padding-top: 4rem;
        padding-bottom: 3rem;
    }

    .carousel button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .carousel .absolute.left-2 {
        left: 0.5rem;
    }

    .carousel .absolute.right-2 {
        right: 0.5rem;
    }

    #mobile-menu {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    #mobile-menu a {
        border-left: 3px solid transparent;
    }

    #mobile-menu a:hover {
        border-left-color: #3b82f6;
    }
}

@media (max-width: 480px) {
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-bg {
        padding: 50px 0 30px;
    }

    .hero-bg h1 {
        font-size: 2rem;
        line-height: 1.1;
    }

    .hero-bg p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .day-cell {
        aspect-ratio: unset;
        min-height: 38px;
        max-height: 42px;
        width: 100%;
        font-size: 11px;
        border-radius: 4px;
        padding: 2px;
    }

    .availability-calendar {
        font-size: 11px;
        gap: 2px;
        width: 100%;
    }

    .day-cell .price {
        font-size: 11px;
    }

    .calendar-header-day {
        padding: 4px 1px;
        font-size: 11px;
    }

    nav .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    nav h1 {
        font-size: 1.5rem;
    }

    .p-6 {
        padding: 1rem;
    }

    .text-2xl {
        font-size: 1.25rem;
    }

    .text-xl {
        font-size: 1.125rem;
    }

    .space-y-4>*+* {
        margin-top: 0.75rem;
    }

    .flex.flex-col.md\:flex-row {
        gap: 0.75rem;
    }

    .grid.grid-cols-2.md\:grid-cols-3.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 360px) {
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .hero-bg h1 {
        font-size: 1.75rem;
    }

    .hero-bg .flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .day-cell {
        aspect-ratio: unset;
        min-height: 32px;
        max-height: 36px;
        width: 100%;
        font-size: 10px;
        padding: 1px;
    }

    .availability-calendar {
        font-size: 10px;
        gap: 1px;
        max-width: 100%;
        overflow: hidden;
    }

    .day-cell .price {
        font-size: 10px;
        margin-top: 0;
    }

    .calendar-header-day {
        padding: 3px 1px;
        font-size: 10px;
    }

    .flex.flex-wrap.gap-2 {
        gap: 0.25rem;
    }

    .px-3.py-1 {
        padding: 0.25rem 0.5rem;
    }

    .text-sm {
        font-size: 0.75rem;
    }

    .grid.grid-cols-2.md\:grid-cols-3.lg\:grid-cols-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Landscape Orientation Adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-bg {
        padding: 40px 0 30px;
    }

    .hero-bg h1 {
        font-size: 2rem;
    }

    .hero-bg p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Container Max-width Adjustments */
@media (min-width: 360px) {
    .container {
        max-width: 360px;
    }
}

@media (min-width: 480px) {
    .container {
        max-width: 480px;
    }
}

/* Print Styles */
@media print {

    .hero-bg,
    nav,
    footer,
    button {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .card-shadow {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card-shadow {
        border: 2px solid #000;
    }

    .day-cell.available {
        background-color: #0066cc;
        border: 2px solid #000;
    }

    .day-cell.unavailable {
        background-color: #cc0000;
        border: 2px solid #000;
    }
}