/* ===========================
   RUBIK PROPERTIES – BUYORSELL
   =========================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --gold: #c9a84c;
    --dark: #1e1e2f;
    --text: #222;
    --radius: 12px;
    --font: 'Poppins', sans-serif;
    --font-heading: 'Playfair Display', serif;
}

body {
    font-family: var(--font);
    background: #f5f5f5;
    color: var(--text);
}

/* Header styles removed, now in antigravity.css */

/* ── PAGE TITLE ─────────────────────────────── */
.page-title {
    background: linear-gradient(135deg, var(--dark) 0%, #2d2d4f 100%);
    color: white;
    text-align: center;
    padding: 70px 20px;
}

.page-title h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 3px;
}

.page-title p {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    letter-spacing: 2px;
}

/* ── PROPERTY SECTIONS ──────────────────────── */
.property-section {
    padding: 60px 40px;
    background: white;
    border-bottom: 1px solid #eee;
}

.property-section:nth-child(even) {
    background: #fafafa;
}

.property-section h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--gold);
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 2px;
}

.listings-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

/* ── LISTING CARD ────────────────────────────── */
.listing-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
}

/* ── IMAGE CAROUSEL (INSPIRED BY INSTAGRAM) ── */
.carousel-container {
    position: relative;
    width: 100%;
    margin: auto;
}

.slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.slider::-webkit-scrollbar {
    display: none;
}

.slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    cursor: zoom-in;
}

.slide img {
    width: 100%;
    display: block;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Carousel Navigation (Arrows) */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0;
    /* Hidden by default */
}

.carousel-container:hover .carousel-nav {
    opacity: 1;
}

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

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

/* Carousel Dots (Pagination) */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.dot.active {
    background: white;
    width: 8px;
    height: 8px;
}


/* Carousel Counter */
.carousel-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    font-style: italic;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

/* ── LISTING DETAILS ─────────────────────────── */
.listing-details {
    padding: 20px;
}

.property-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.property-specs li {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 6px;
}

.property-specs li:last-child {
    border-bottom: none;
}

.property-specs li strong {
    color: #888;
    font-weight: 500;
}

.price-highlight {
    color: var(--gold);
    font-weight: 700;
}

.listing-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wa-btn {
    display: inline-block;
    background: #ff8c00;
    /* Orange */
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.2s;
}

.wa-btn:hover {
    background: #e67e00;
    /* Darker orange */
}

.no-listings {
    text-align: center;
    padding: 80px 20px;
    color: #888;
    font-size: 1.1rem;
}

/* ── MESSAGES ────────────────────────────────── */
.messages-container {
    max-width: 680px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.close-msg {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    margin-left: 10px;
    opacity: 0.7;
}

.close-msg:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

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

/* ── SUBMISSION FORM ─────────────────────────── */
.add-property {
    background: var(--dark);
    padding: 70px 40px;
}

.add-property h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--gold);
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 2rem;
}

.form-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #111;
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.add-property form {
    max-width: 680px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.add-property input,
.add-property select,
.add-property textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: white;
    padding: 13px 16px;
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.add-property input::placeholder,
.add-property textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.add-property input:focus,
.add-property select:focus,
.add-property textarea:focus {
    border-color: var(--gold);
}

.add-property select option {
    background: #1e1e2f;
    color: white;
}

.file-upload-area {
    border: 2px dashed rgba(201, 168, 76, 0.4);
    border-radius: 8px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-area:hover {
    border-color: var(--gold);
    background: rgba(201, 168, 76, 0.04);
}

.file-upload-area input[type="file"] {
    display: none;
}

.submit-btn {
    background: linear-gradient(90deg, var(--gold), #e8c96a);
    color: #111;
    font-weight: 700;
    font-family: var(--font);
    font-size: 1rem;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: opacity 0.2s, transform 0.15s;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── LIGHTBOX ────────────────────────────────── */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

/* ── FOOTER ──────────────────────────────────── */
footer {
    background: #111;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

/* ── IMAGE PREVIEW UI ───────────────────────── */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.add-more-box {
    width: 80px;
    height: 80px;
    border: 2px dashed rgba(201, 168, 76, 0.4);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.add-more-box:hover {
    background: rgba(201, 168, 76, 0.05);
    border-color: var(--gold);
}

@media (max-width: 640px) {
    .form-tabs {
        flex-direction: column;
        gap: 10px;
    }

    .tab-btn {
        width: 100%;
    }

    .add-property {
        padding: 40px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    header {
        padding: 14px 20px;
    }

    nav ul {
        gap: 2px;
    }

    nav ul li a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .property-section {
        padding: 40px 20px;
    }

    .listings-container {
        grid-template-columns: 1fr;
    }

    .page-title h1 {
        font-size: 1.8rem;
    }
}