/* NaijaMarketplace Custom Styles */

/* CSS Variables for Nigerian Theme */
:root {
    --naija-green: #008751;
    --naija-green-light: #38a169;
    --naija-green-dark: #065f46;
    --naija-white: #ffffff;
    --naija-gray: #718096;
    --naija-dark: #1a202c;
    --primary-gradient: linear-gradient(135deg, #008751 0%, #38a169 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Global Styles */
* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f7fafc;
}

::-webkit-scrollbar-thumb {
    background: var(--naija-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--naija-green-dark);
}

/* Utility Classes */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Header Styles */
header {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.logo-container:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Search Bar Enhancements */
.search-container {
    position: relative;
}

.search-container::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--primary-gradient);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.search-container:focus-within::before {
    opacity: 1;
}

.search-btn {
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.search-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Category Cards */
.category-card {
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.category-card:hover::before {
    left: 100%;
}

.category-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Listing Cards */
.listing-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.listing-card .image-container {
    position: relative;
    overflow: hidden;
}

.listing-card .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.listing-card:hover .image-overlay {
    background: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Badges */
.badge-featured {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.badge-urgent {
    background: linear-gradient(135deg, #e53e3e 0%, #fc8181 100%);
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
    animation: pulse-urgent 2s infinite;
}

.badge-verified {
    background: linear-gradient(135deg, var(--naija-green) 0%, var(--naija-green-light) 100%);
    box-shadow: 0 2px 4px rgba(0, 135, 81, 0.3);
}

@keyframes pulse-urgent {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(229, 62, 62, 0.5);
    }
}

/* Button Styles */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 135, 81, 0.3);
}

.btn-secondary {
    background: white;
    border: 2px solid var(--naija-green);
    color: var(--naija-green);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--naija-green);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 135, 81, 0.2);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 135, 81, 0.03) 0%, rgba(56, 161, 105, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23008751' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(-60px, -60px);
    }
}

/* Stats Animation */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    animation: statFadeIn 0.8s ease forwards;
}

.stat-item:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-item:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Feature Section Icons */
.feature-icon {
    position: relative;
    background: var(--naija-green);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--naija-green-light);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.feature-icon:hover::before {
    transform: scale(1);
}

.feature-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 135, 81, 0.3);
}

/* Trust & Safety Icons */
.safety-feature {
    transition: all 0.3s ease;
}

.safety-feature:hover {
    transform: translateY(-2px);
}

.safety-feature .safety-icon {
    transition: all 0.3s ease;
}

.safety-feature:hover .safety-icon {
    transform: scale(1.1);
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.footer-link {
    transition: all 0.3s ease;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--naija-green);
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .listing-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }

    /* Mobile CTA Slideshow */
    .cta-slide h2 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .cta-slide p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .cta-slide .flex {
        flex-direction: column;
        gap: 1rem;
    }

    .slide-indicator {
        width: 10px;
        height: 10px;
    }

    #prev-slide,
    #next-slide {
        display: none; /* Hide navigation arrows on mobile */
    }

    .floating-shapes {
        display: none; /* Hide floating shapes on mobile for performance */
    }
}

/* Accessibility Improvements */
.focus-visible {
    outline: 2px solid var(--naija-green);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --text-primary: #f7fafc;
        --text-secondary: #a0aec0;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .listing-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --naija-green: #000000;
        --naija-green-light: #333333;
    }
    
    .btn-primary {
        background: #000000;
        color: #ffffff;
    }
}

/* WhatsApp Button */
.whatsapp-float {
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Interactive Elements */
.interactive {
    cursor: pointer;
    transition: all 0.2s ease;
}

.interactive:hover {
    transform: scale(1.02);
}

.interactive:active {
    transform: scale(0.98);
}

/* Success/Error States */
.success {
    color: #22c55e;
    background-color: #dcfce7;
    border-color: #86efac;
}

.error {
    color: #ef4444;
    background-color: #fef2f2;
    border-color: #fca5a5;
}

.warning {
    color: #f59e0b;
    background-color: #fffbeb;
    border-color: #fcd34d;
}

/* Custom Animations */
@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-slideInFromBottom {
    animation: slideInFromBottom 0.6s ease-out;
}

.animate-slideInFromRight {
    animation: slideInFromRight 0.6s ease-out;
}

.animate-fadeInScale {
    animation: fadeInScale 0.6s ease-out;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 1000;
    max-width: 400px;
    animation: slideInFromRight 0.3s ease-out;
}

.notification.success {
    border-left: 4px solid #22c55e;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

/* CTA Slideshow Styles */
.cta-slide {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease-in-out;
}

.cta-slide.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

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

.slide-indicator.active {
    background: white;
    transform: scale(1.2);
}

.slide-indicator:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Floating Background Shapes */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: 5s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 70%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
        opacity: 0.6;
    }
    66% {
        transform: translateY(10px) rotate(240deg);
        opacity: 0.4;
    }
}

/* Slideshow Animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-left {
    animation: slideInLeft 0.7s ease-out;
}

.slide-right {
    animation: slideInRight 0.7s ease-out;
}

.slide-up {
    animation: slideInUp 0.7s ease-out;
}