/**
 * 035 Marketplace - Main Stylesheet
 * Designed to match the provided mockup exactly
 */

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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1f2937;
    --light-bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

/* ========== HERO SLIDER ========== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #000;
}

/* Hero Logo Overlay */
.hero-logo {
    position: absolute;
    top: 20px;
    left: 40px;
    z-index: 10;
    background: transparent;
    padding: 0;
    transition: var(--transition);
}

.hero-logo:hover {
    transform: scale(1.05);
}

.hero-logo img {
    height: 120px;
    width: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    width: 90%;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-content p {
    font-size: 1.5rem;
    font-weight: 400;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

/* Hero Navigation Arrows */
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: var(--transition);
    z-index: 3;
}

.hero-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.hero-nav.prev {
    left: 20px;
}

.hero-nav.next {
    right: 20px;
}

/* Hero Indicators */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

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

.hero-indicator.active {
    background: white;
    width: 30px;
    border-radius: 6px;
}

/* ========== MAIN CONTAINER ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* ========== CONTENT AREA (80%) ========== */
.content-area {
    flex: 0 0 78%;
}

.businesses-header {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== BUSINESS GRID ========== */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.business-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.business-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--light-bg);
    overflow: hidden;
}

.business-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.business-card:hover .business-card-image img {
    transform: scale(1.05);
}

.business-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    z-index: 1;
}

.business-card-content {
    padding: 1.25rem;
}

.business-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.business-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== SIDEBAR (20%) ========== */
.sidebar {
    flex: 0 0 20%;
    position: sticky;
    top: 2rem;
}

.sidebar-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--secondary-color);
}

/* Categories */
.categories-list {
    list-style: none;
}

.category-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.category-item:hover {
    background: var(--light-bg);
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.category-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.category-item.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Modal Image Slider */
.modal-slider {
    position: relative;
    width: 100%;
    height: 400px;
    background: #000;
    overflow: hidden;
}

.modal-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-slide.active {
    opacity: 1;
}

.modal-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.modal-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 5;
}

.modal-slider-nav:hover {
    background: white;
}

.modal-slider-nav.prev {
    left: 10px;
}

.modal-slider-nav.next {
    right: 10px;
}

.modal-body {
    padding: 2rem;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.modal-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.modal-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary {
    background: var(--success-color);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Alert */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Contact Info */
.contact-info {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 12px;
}

.contact-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.contact-text {
    flex: 1;
}

.contact-label {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.2rem;
}

.contact-value {
    color: var(--text-secondary);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-logo {
    margin-bottom: 1rem;
}

.footer-logo img {
    height: 60px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.footer-section p {
    color: #9ca3af;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #9ca3af;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding: 1.5rem 0;
    text-align: center;
    color: #9ca3af;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }

    .content-area {
        flex: 1 1 100%;
    }

    .sidebar {
        flex: 1 1 100%;
        position: relative;
        top: 0;
    }

    .business-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-slider {
        height: 300px;
    }

    .hero-logo {
        top: 10px;
        left: 20px;
    }

    .hero-logo img {
        height: 80px;
    }

    .business-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-slider {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .business-grid {
        grid-template-columns: 1fr;
    }

    .hero-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .hero-logo img {
        height: 70px;
    }
}

/* ========== LOADING SPINNER ========== */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

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

/* ========== UTILITY CLASSES ========== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}
