/* Villa Catalog Website - Light Theme Design System */
/* Inspired by modern booking platforms like Airbnb */

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
    /* Color Palette - Light & Bright */
    --primary-color: #FF385C;
    --primary-hover: #E31C5F;
    --secondary-color: #00A699;
    --accent-color: #FF5A5F;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F7F7F7;
    --bg-tertiary: #EBEBEB;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F7F7F7;

    --text-primary: #222222;
    --text-secondary: #717171;
    --text-muted: #B0B0B0;

    --border-color: #DDDDDD;
    --border-light: #EBEBEB;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #FF385C 0%, #E61E4D 100%);
    --secondary-gradient: linear-gradient(135deg, #00A699 0%, #008489 100%);
    --overlay-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.18);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--text-primary);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.logo:hover {
    color: var(--primary-hover);
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-md);
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
}

/* ============================================
   VILLA GRID
   ============================================ */
.villa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

/* ============================================
   VILLA CARD
   ============================================ */
.villa-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.villa-card:nth-child(1) {
    animation-delay: 0.1s;
}

.villa-card:nth-child(2) {
    animation-delay: 0.2s;
}

.villa-card:nth-child(3) {
    animation-delay: 0.3s;
}

.villa-card:nth-child(4) {
    animation-delay: 0.4s;
}

.villa-card:nth-child(5) {
    animation-delay: 0.5s;
}

.villa-card:nth-child(6) {
    animation-delay: 0.6s;
}

.villa-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.villa-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.villa-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.villa-card:hover .villa-image {
    transform: scale(1.05);
}

.image-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.villa-content {
    padding: var(--spacing-md);
}

.villa-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 600;
}

.villa-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.villa-location::before {
    content: '📍';
}

.villa-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.villa-features {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.villa-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.price-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-primary);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-primary);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #008489;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--primary-color);
    color: white;
}

.btn-danger:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: var(--shadow-xl);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    transform: scale(1.1);
}

/* ============================================
   IMAGE CAROUSEL
   ============================================ */
.carousel-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: var(--bg-tertiary);
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
}

.carousel-button:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 16px;
}

.carousel-button.next {
    right: 16px;
}

.carousel-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-button:disabled:hover {
    transform: translateY(-50%);
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    padding: 0;
}

.indicator-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.9);
}

.image-counter {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 5;
}

.modal-body {
    padding: var(--spacing-xl);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

/* Multiple Image Inputs */
.image-inputs-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.image-input-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.image-input-row input {
    flex: 1;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.villa-list {
    display: grid;
    gap: var(--spacing-md);
}

.villa-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.villa-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
}

.villa-item-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.villa-item-content {
    flex: 1;
}

.villa-item-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: var(--spacing-lg) auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    animation: slideInRight 0.3s ease;
    border: 1px solid;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #991B1B;
}

.alert-info {
    background: #DBEAFE;
    border-color: #3B82F6;
    color: #1E40AF;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .nav-links {
        gap: var(--spacing-md);
    }

    .villa-grid {
        grid-template-columns: 1fr;
    }

    .carousel-container {
        height: 300px;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .admin-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

    .villa-item {
        flex-direction: column;
    }

    .villa-item-image {
        width: 100%;
        height: 150px;
    }

    .carousel-button {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .carousel-button.prev {
        left: 8px;
    }

    .carousel-button.next {
        right: 8px;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
    }

    .container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    .carousel-container {
        height: 250px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-container {
    background: white;
    padding: 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-xl);
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    max-width: 900px;
    margin: 0 auto 4rem auto;
    /* Added bottom margin */
    position: relative;
    top: 20px;
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
    z-index: 10;
    /* Ensure it stays on top if needed */
}

.search-input-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    padding-right: 1rem;
    border-right: 1px solid var(--border-light);
}

.search-input-group:last-of-type {
    border-right: none;
}

.search-input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 0.5rem;
}

.search-input-group input {
    border: none;
    background: transparent;
    padding: 0.5rem 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
    width: 100%;
    font-family: var(--font-primary);
}

.search-input-group input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* Mobile Responsive Search */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        border-radius: var(--radius-xl);
        gap: 1.5rem;
        align-items: stretch;
        padding: 1.5rem;
    }

    .search-input-group {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 1rem;
        padding-right: 0;
    }

    .search-input-group:last-of-type {
        border-bottom: none;
    }

    .search-container .btn {
        width: 100%;
        margin-top: 0.5rem;
        border-radius: var(--radius-lg);
    }
}