/*
Theme Name: VSNSoft Directory
Theme URI: https://vsnsoft.com/
Author: VSNSoft
Author URI: https://vsnsoft.com/
Description: Custom classified marketplace theme for Madurai.xyz with advanced listing features, category-wise fields, and advertisement system.
Version: 1.0.0
License: GPL v2 or later
Text Domain: vsnsoftdir
*/

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: #0073aa;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #005a87;
}

/* Buttons */
.btn,
button,
input[type="submit"] {
    display: inline-block;
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.btn-primary {
    background: #ff9800;
}

.btn-primary:hover {
    background: #f57c00;
}

.btn-outline {
    background: transparent;
    border: 2px solid #0073aa;
    color: #0073aa;
}

.btn-outline:hover {
    background: #0073aa;
    color: white;
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo img {
    max-height: 50px;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.main-nav li a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
}

.main-nav li a:hover {
    color: #0073aa;
}

.main-nav .current-menu-item a {
    color: #0073aa;
}

.post-ad-btn {
    background: #ff9800;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
}

.post-ad-btn:hover {
    background: #f57c00;
    color: white;
}

/* Footer */
.site-footer {
    background: #1a1a1a;
    color: #999;
    padding: 50px 20px 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-widget h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: #999;
    text-decoration: none;
}

.footer-widget a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #333;
    font-size: 13px;
}

/* Listing Cards */
.vsn-listing-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.vsn-listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.vsn-listing-card .card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.vsn-listing-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vsn-listing-card:hover .card-image img {
    transform: scale(1.05);
}

.vsn-listing-card .card-content {
    padding: 15px;
}

.vsn-listing-card .card-category {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
}

.vsn-listing-card .card-title {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.vsn-listing-card .card-price {
    color: #0073aa;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.vsn-listing-card .card-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.vsn-listing-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Badges */
.badge-featured {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff9800;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
}

.badge-sold {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
}

/* Search Form */
.vsn-search-form {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    padding: 60px 20px;
}

.search-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.search-form-wrapper h2 {
    color: white;
    text-align: center;
    margin-bottom: 15px;
}

.search-form-wrapper p {
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 30px;
}

.search-input-group {
    background: white;
    border-radius: 60px;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-input-group input,
.search-input-group select {
    flex: 1;
    min-width: 180px;
    padding: 16px 20px;
    border: none;
    border-radius: 50px;
    outline: none;
    font-size: 15px;
}

.search-input-group button {
    background: #ff9800;
    padding: 16px 35px;
    border-radius: 50px;
    font-weight: bold;
}

/* Category Strip */
.vsn-category-strip {
    padding: 40px 20px;
    background: white;
}

.category-slider-wrapper {
    position: relative;
}

.category-slider {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 10px 0;
}

.category-slider::-webkit-scrollbar {
    height: 6px;
}

.category-slider::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.category-slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.category-slider::-webkit-scrollbar-thumb:hover {
    background: #0073aa;
}

.category-item {
    text-decoration: none;
    text-align: center;
    display: inline-block;
    min-width: 90px;
    transition: transform 0.2s;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 12px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s;
}

.category-item:hover .category-icon {
    background: #0073aa;
    box-shadow: 0 5px 15px rgba(0,115,170,0.2);
}

.category-item:hover .category-icon img {
    filter: brightness(0) invert(1);
}

.category-name {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Filter Bar */
.vsn-filter-bar {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Grid and List Views */
.vsn-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.vsn-list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vsn-list-view .vsn-listing-card {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.vsn-list-view .vsn-listing-card .card-image {
    width: 200px;
    flex-shrink: 0;
    height: 150px;
}

.vsn-list-view .vsn-listing-card .card-content {
    flex: 1;
}

.view-toggle.active {
    color: #0073aa;
    font-weight: bold;
}

/* Pagination */
.vsn-pagination {
    margin-top: 40px;
    text-align: center;
}

.vsn-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    text-decoration: none;
}

.vsn-pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.vsn-pagination .page-numbers:hover:not(.current) {
    background: #f5f5f5;
}

/* Location Chips */
.location-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.location-chip {
    background: white;
    padding: 12px 24px;
    border-radius: 40px;
    text-decoration: none;
    color: #333;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.location-chip:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,115,170,0.2);
}

/* Contact Card */
.contact-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: sticky;
    top: 100px;
}

.contact-card h3 {
    margin-top: 0;
}

.contact-card .phone-btn {
    display: block;
    background: #0073aa;
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: bold;
}

.contact-card .whatsapp-btn {
    display: block;
    background: #25d366;
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

/* Gallery */
.listing-gallery {
    margin-bottom: 30px;
}

.gallery-main {
    position: relative;
    margin-bottom: 15px;
}

.gallery-main img {
    width: 100%;
    border-radius: 12px;
    min-height: 400px;
    object-fit: cover;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumb.active {
    border-color: #0073aa;
}

/* Details Section */
.details-section {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.detail-item {
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.detail-item strong {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Notifications */
.vsn-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.vsn-notification-success { background: #4caf50; color: white; }
.vsn-notification-error { background: #f44336; color: white; }
.vsn-notification-info { background: #2196f3; color: white; }

/* Loading Spinner */
.vsn-loading-spinner {
    text-align: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .search-input-group input,
    .search-input-group select,
    .search-input-group button {
        border-radius: 30px !important;
    }
    
    .vsn-list-view .vsn-listing-card {
        flex-direction: column;
    }
    
    .vsn-list-view .vsn-listing-card .card-image {
        width: 100%;
        height: 200px;
    }
    
    .gallery-main img {
        min-height: 250px;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }