/**
 * HABARIDUKA Marketplace Design System
 * Multi-Author Book & Blog Marketplace
 * 
 * Brand Colors:
 * - Primary: #00bf63 (Green)
 * - Secondary: #FDFBD4 (Light Cream)
 * - Accent: #EDE8D0 (Warm Cream)
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #00bf63;
    --primary-dark: #00a854;
    --primary-light: #33cc7f;
    --primary-rgb: 0, 191, 99;
    
    /* Secondary Colors */
    --secondary: #FDFBD4;
    --secondary-dark: #EDE8D0;
    --accent: #EDE8D0;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;
    
    /* Semantic Colors */
    --success: #00bf63;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-primary);
    --font-mono: 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 10px 40px rgba(var(--primary-rgb), 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body.marketplace {
    font-family: var(--font-primary);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.6;
}

/* ============================================
   MARKETPLACE HEADER
   ============================================ */
.mp-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition-base);
}

.mp-header.scrolled {
    box-shadow: var(--shadow-md);
}

.mp-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.mp-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.mp-logo i {
    font-size: 1.75rem;
}

/* Search Bar */
.mp-search {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.mp-search-input {
    position: relative;
}

.mp-search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.mp-search-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.mp-search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* Navigation */
.mp-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mp-nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.mp-nav-link:hover {
    color: var(--primary);
}

.mp-nav-link.active {
    color: var(--primary);
}

/* Auth Buttons */
.mp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.mp-btn-primary {
    background: var(--primary);
    color: var(--white);
}

.mp-btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
}

.mp-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.mp-btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.mp-btn-secondary {
    background: var(--secondary);
    color: var(--gray-800);
}

.mp-btn-secondary:hover {
    background: var(--secondary-dark);
}

.mp-btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* User Menu */
.mp-user-menu {
    position: relative;
}

.mp-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
}

/* Cart Icon */
.mp-cart-icon {
    position: relative;
    color: var(--gray-700);
    font-size: 1.25rem;
}

.mp-cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   HERO SECTION
   ============================================ */
.mp-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    position: relative;
    overflow: hidden;
}

.mp-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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='%2300bf63' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.mp-hero-content {
    position: relative;
    z-index: 1;
}

.mp-hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.mp-hero-title span {
    color: var(--primary);
}

.mp-hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 500px;
    margin-bottom: 2rem;
}

.mp-hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.mp-hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
}

.mp-hero-stat {
    text-align: center;
}

.mp-hero-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.mp-hero-stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ============================================
   FEATURED BOOKS CAROUSEL
   ============================================ */
.mp-featured-carousel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 1.5rem;
}

.mp-featured-book {
    width: 180px;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
}

.mp-featured-book:hover {
    transform: translateY(-10px) rotate(-2deg);
    box-shadow: var(--shadow-xl);
}

.mp-featured-book img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* ============================================
   SECTION STYLES
   ============================================ */
.mp-section {
    padding: 80px 0;
}

.mp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mp-section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.mp-section-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-section-link:hover {
    text-decoration: underline;
}

/* Section with Cream Background */
.mp-section-cream {
    background: var(--secondary);
}

/* ============================================
   BOOK CARDS
   ============================================ */
.mp-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.mp-book-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    text-decoration: none;
    color: inherit;
}

.mp-book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mp-book-cover {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.mp-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-base);
}

.mp-book-card:hover .mp-book-cover img {
    transform: scale(1.05);
}

.mp-book-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.mp-book-badge.sale {
    background: var(--danger);
}

.mp-book-badge.free {
    background: var(--info);
}

.mp-book-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-fast);
}

.mp-book-card:hover .mp-book-actions {
    opacity: 1;
    transform: translateY(0);
}

.mp-book-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.mp-book-action-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.mp-book-info {
    padding: 1rem;
}

.mp-book-category {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.mp-book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mp-book-author {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.mp-book-author a {
    color: var(--gray-600);
    text-decoration: none;
}

.mp-book-author a:hover {
    color: var(--primary);
}

.mp-book-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-book-price-current {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.mp-book-price-old {
    font-size: 0.9rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

.mp-book-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.mp-book-rating i {
    color: #fbbf24;
    font-size: 0.8rem;
}

.mp-book-rating span {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-left: 0.25rem;
}

/* ============================================
   DEAL OF THE DAY
   ============================================ */
.mp-deal {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    border-radius: var(--radius-xl);
    padding: 3rem;
    color: var(--white);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 3rem;
    align-items: center;
}

.mp-deal-cover {
    width: 200px;
    height: 280px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.mp-deal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-deal-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.mp-deal-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mp-deal-author {
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.mp-deal-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mp-deal-price-current {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.mp-deal-price-old {
    font-size: 1.25rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.mp-deal-timer {
    text-align: center;
}

.mp-deal-timer-label {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.mp-deal-countdown {
    display: flex;
    gap: 0.75rem;
}

.mp-deal-countdown-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    min-width: 60px;
}

.mp-deal-countdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.mp-deal-countdown-label {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
}

/* ============================================
   CATEGORIES GRID
   ============================================ */
.mp-categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.mp-category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
    border: 2px solid transparent;
}

.mp-category-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mp-category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    transition: var(--transition-base);
}

.mp-category-card:hover .mp-category-icon {
    background: var(--primary);
    color: var(--white);
}

.mp-category-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.mp-category-count {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   BECOME AN AUTHOR CTA
   ============================================ */
.mp-author-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 80px 0;
    color: var(--white);
    text-align: center;
}

.mp-author-cta-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.mp-author-cta-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.mp-author-cta .mp-btn-secondary {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.mp-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 60px 0 30px;
}

.mp-footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.mp-footer-brand {
    max-width: 300px;
}

.mp-footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mp-footer-logo i {
    color: var(--primary);
}

.mp-footer-desc {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.mp-footer-social {
    display: flex;
    gap: 1rem;
}

.mp-footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-800);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.mp-footer-social a:hover {
    background: var(--primary);
    color: var(--white);
}

.mp-footer-title {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.mp-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mp-footer-links li {
    margin-bottom: 0.75rem;
}

.mp-footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition-fast);
}

.mp-footer-links a:hover {
    color: var(--primary);
}

.mp-footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .mp-categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mp-deal {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .mp-deal-cover {
        margin: 0 auto;
    }
    
    .mp-deal-countdown {
        justify-content: center;
    }
    
    .mp-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mp-header {
        height: 60px;
    }
    
    .mp-search {
        display: none;
    }
    
    .mp-hero {
        padding: 100px 0 60px;
    }
    
    .mp-hero-title {
        font-size: 2.25rem;
    }
    
    .mp-hero-stats {
        gap: 1.5rem;
    }
    
    .mp-section {
        padding: 50px 0;
    }
    
    .mp-book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .mp-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .mp-footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .mp-book-grid {
        grid-template-columns: 1fr;
    }
    
    .mp-hero-actions {
        flex-direction: column;
    }
    
    .mp-btn {
        width: 100%;
        justify-content: center;
    }
}
