/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 4px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 30px;
    border-radius: 10px;
    position: relative;
}

header h1 {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Add listing button (top-right) - hidden now */
.add-listing-btn { display: none; }

/* Mobile hamburger menu */
.nav-toggle { display: none; }
.hamburger {
    display: none;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 22px;
    cursor: pointer;
}
.hamburger span {
    display: block;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
}
.mobile-menu {
    display: none;
    position: absolute;
    right: 8px;
    top: 100%;
    background: #ffffff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    min-width: 180px;
    z-index: 20;
}
.mobile-menu a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}
.mobile-menu a:hover { background: #f3f4f6; }

.nav-toggle:checked + .hamburger + .mobile-menu { display: block; }

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* New: vertical rows that mimic the provided screenshot */
.listings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.listing-row {
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.listing-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1e1e1e;
    color: #fff;
}

.listing-row-title {
    color: #ffd54f;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
}

.listing-row-title:hover {
    text-decoration: underline;
}

.listing-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listing-city {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #2e7d32;
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
}

.listing-row-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    position: relative;
}

.listing-thumb {
    position: relative;
    width: 100%;
    padding-top: 166.65%;
    overflow: hidden;
    background: #000;
}

.listing-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Verified badge image (replaces VIP) */
.verified-badge-img {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

/* Extra guard to override generic .listing-thumb img rule and any cached styles */
.listing-thumb > .verified-badge-img {
    top: 6px !important;
    left: 6px !important;
    width: 28px !important;
    height: 28px !important;
}

/* Smaller verified badge on mobile */
@media (max-width: 768px) {
    .listing-thumb > .verified-badge-img {
        top: 4px !important;
        left: 4px !important;
        width: 18px !important;
        height: 18px !important;
    }
}

/* Small labels under each image */
.image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
    padding: 4px 6px;
    text-align: center;
}

.image-label span {
    display: block;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: adBlink 1.2s infinite ease-in-out;
}

.label-name {
    color: #ffd54f;
}

.label-subtitle {
    color: #ff9800;
}

.label-city {
    color: #4caf50;
}

@keyframes adBlink {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(255,255,0,0.9)); }
    50% { opacity: 0.5; filter: drop-shadow(0 0 3px rgba(255,255,255,0.5)); }
}

.listing-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: block;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.listing-image {
    position: relative;
    width: 100%;
    padding-top: 133%;
    overflow: hidden;
}

.listing-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 20px;
    color: white;
}

.listing-overlay h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.listing-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Detail Page */
.detail-page {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-link {
    margin-bottom: 20px;
}

.back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.back-link a:hover {
    text-decoration: underline;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.detail-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-right {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-header {
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    text-align: left;
}

.detail-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

/* Verified icon next to name on detail page */
.verified-inline {
    height: 1em;
    width: auto;
    margin-left: 3px;
    vertical-align: middle;
}

.detail-header h2 {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: normal;
}

/* Tighter spacing when header is above slideshow on the left column */
.detail-left .detail-header {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: none;
}

.detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.detail-gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.detail-info {
    max-width: 800px;
    margin: 0 auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.info-item {
    font-size: 1rem;
}

.info-item strong {
    color: #667eea;
    display: inline-block;
    min-width: 80px;
}

.description {
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    line-height: 1.9;
    font-size: 1rem;
    text-align: justify;
}

.detail-info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.detail-info-box p {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stats-row span {
    font-size: 0.95rem;
}

.stats-row strong {
    color: #667eea;
}

.contact-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #1fb855;
}

.btn-phone {
    background: #667eea;
    color: white;
}

.btn-phone:hover {
    background: #5568d3;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    color: #856404;
}

.warning-box strong {
    display: block;
    margin-bottom: 10px;
    color: #d9534f;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

/* Admin Login */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Admin Container */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #667eea;
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.admin-header h1 {
    font-size: 1.0rem;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Admin mobile menu */
.admin-nav-toggle { display: none; }
.admin-hamburger {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 22px;
    cursor: pointer;
}
.admin-hamburger span {
    display: block;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
}
.admin-mobile-menu {
    display: none;
    position: absolute;
    right: 12px;
    top: 100%;
    background: #667eea;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    overflow: hidden;
    min-width: 200px;
    z-index: 15;
}
.admin-mobile-menu a {
    display: block;
    color: #fff;
    padding: 10px 14px;
    margin: 0;
}
.admin-mobile-menu a:hover { background: rgba(255,255,255,0.15); }
.admin-nav-toggle:checked + .admin-hamburger + .admin-mobile-menu {
    display: block;
}
.admin-hamburger { display: block; }

/* Admin Actions */
.admin-actions {
    margin-bottom: 20px;
}

/* Admin Table */
.admin-table {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.thumbnail {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    white-space: nowrap;
}

.btn-small {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-view {
    background: #17a2b8;
    color: white;
}

.btn-view:hover {
    background: #138496;
}

/* Forms */
.admin-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.current-image img {
    max-width: 200px;
    border-radius: 5px;
    margin: 10px 0;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 5px;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

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

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

.text-center {
    text-align: center;
}

/* Slideshow */
.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.slide {
    display: none;
    width: 100%;
    position: relative;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

.slideshow-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 16px;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    transition: background 0.3s ease;
    border-radius: 4px;
}

.slideshow-control:hover {
    background: rgba(0, 0, 0, 0.9);
}

.slideshow-control.prev {
    left: 10px;
}

.slideshow-control.next {
    right: 10px;
}

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

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

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
    background: white;
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .hamburger { display: block; }
    
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .detail-page {
        padding: 20px;
    }
    
    .detail-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .detail-header {
        text-align: center;
    }
    
    .detail-header h1 {
        font-size: 1.5rem;
    }
    
    .detail-header h2 {
        font-size: 1rem;
    }
    
    .slide img {
        max-height: 400px;
    }
    
    .slideshow-control {
        padding: 12px;
        font-size: 18px;
    }
    
    .slideshow-control.prev {
        left: 5px;
    }
    
    .slideshow-control.next {
        right: 5px;
    }
    
    .description {
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .contact-section {
        flex-direction: column;
    }
    
    .contact-section .btn {
        width: 100%;
        text-align: center;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 10px;
    }

    .listing-row-images {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .admin-header {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-header nav {
        margin-top: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Desktop specific tweaks */
@media (min-width: 769px) {
    .listing-thumb {
        padding-top: 83.325%;
    }
    /* Ensure mobile nav hidden on desktop */
    .hamburger { display: none; }
    .mobile-menu { display: none !important; }
}
