/*
 * Marketplace Styles
 * ==================
 * 
 * Modern, responsive styling for the ZAROCKET OS marketplace
 * Includes pricing cards, package layouts, and plan builder components
 */

:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #338ee6;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 8px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.15s ease-in-out;
}

/* === Base Styles === */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

/* === Hero Section === */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

/* === Filter Badges === */
.filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.filter-badge:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.filter-badge.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* === Pricing Cards === */
.pricing-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.15);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    position: relative;
}

.pricing-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

.badge-popular {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.price-tag {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.price-tag sup {
    font-size: 1rem;
    font-weight: 500;
    vertical-align: top;
}

.price-tag sub {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-600);
    vertical-align: baseline;
}

/* === Features List === */
.features-list {
    list-style: none;
    padding: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list i {
    color: var(--success-color);
    margin-right: 0.5rem;
    width: 16px;
    flex-shrink: 0;
}

/* === Module Cards === */
.module-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
}

.module-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.module-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.module-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

/* === Plan Builder Styles === */
.plan-summary {
    position: sticky;
    top: 100px;
    z-index: 10;
}

.price-breakdown {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.line-item:last-child {
    border-bottom: none;
}

.line-item.total {
    border-top: 2px solid var(--gray-300);
    margin-top: 1rem;
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
}

/* === Stats & Benefit Items === */
.stats-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.stats-item:last-child {
    border-bottom: none;
}

.benefit-item {
    text-align: center;
    padding: 1.5rem;
    height: 100%;
}

.benefit-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

/* === Tab Navigation === */
.nav-pills .nav-link {
    border-radius: 0;
    color: var(--gray-600);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.nav-pills .nav-link:hover {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-light);
}

.nav-pills .nav-link.active {
    background: transparent;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* === Button Styles === */
.btn {
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    transform: translateY(-1px);
}

/* === Avatars === */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

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

/* === Form Enhancements === */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

/* === Tooltips & Popovers === */
.tooltip-inner {
    background: var(--dark-color);
    color: white;
    border-radius: var(--border-radius);
}

/* === Loading States === */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    transform: none !important;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .price-tag {
        font-size: 2rem;
    }
    
    .filter-badge {
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .pricing-card {
        margin-bottom: 1.5rem;
    }
    
    .plan-summary {
        position: static;
        margin-top: 2rem;
    }
    
    .benefit-item {
        padding: 1rem;
    }
    
    .benefit-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .price-tag {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.875rem;
    }
    
    .nav-pills .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* === Dark Mode Support === */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-100: #1a1a1a;
        --gray-200: #2a2a2a;
        --gray-300: #3a3a3a;
        --gray-400: #4a4a4a;
        --gray-500: #5a5a5a;
        --gray-600: #6a6a6a;
        --gray-700: #7a7a7a;
        --gray-800: #8a8a8a;
        --gray-900: #9a9a9a;
    }
    
    body {
        background: #121212;
        color: #e0e0e0;
    }
    
    .pricing-card {
        background: #1e1e1e;
        border-color: #3a3a3a;
    }
    
    .price-breakdown {
        background: #2a2a2a;
    }
}

/* === Print Styles === */
@media print {
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .btn {
        display: none !important;
    }
    
    .pricing-card {
        page-break-inside: avoid;
        border: 2px solid #333 !important;
    }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .pricing-card {
        border-width: 3px;
    }
    
    .btn {
        border-width: 2px;
    }
    
    .filter-badge {
        border-width: 2px;
    }
}