/**
 * Smart Digital Marketplace - Custom Styles
 * JHAPA TECHNICAL
 */

/* CSS Variables - Enhanced Color Palette */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --body-font: 'Inter', sans-serif;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --box-shadow-xl: 0 25px 50px -12px rgba(99, 102, 241, 0.25);
}

/* Base Styles */
body {
    font-family: var(--body-font);
    background-color: #f8fafc;
    color: #374151;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
}

/* Stats Section */
.stats-section .stat-item {
    padding: 1.5rem;
}

.stats-section h3 {
    font-size: 2rem;
    font-weight: 700;
}

/* Category Cards - Enhanced */
.category-card {
    border-radius: var(--border-radius);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--box-shadow-xl) !important;
    border-color: rgba(99, 102, 241, 0.3);
}

.category-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

/* Product Cards */
.product-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

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

.product-card:hover .product-overlay {
    opacity: 1;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

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

/* Form Controls */
.form-control {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.625rem 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Cards */
.card {
    border-radius: var(--border-radius);
    border: none;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Dashboard Sidebar */
.dashboard-sidebar {
    min-height: calc(100vh - 72px);
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: #f3f4f6;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-menu li a i {
    width: 24px;
    margin-right: 0.75rem;
}

/* Dashboard Stats Cards */
.stat-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td {
    vertical-align: middle;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-pending::before {
    background-color: #f59e0b;
}

.status-approved,
.status-completed,
.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-approved::before,
.status-completed::before,
.status-active::before {
    background-color: #22c55e;
}

.status-rejected,
.status-cancelled,
.status-revoked {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-rejected::before,
.status-cancelled::before,
.status-revoked::before {
    background-color: #ef4444;
}

/* Product Detail Page */
.product-gallery {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.product-gallery .main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.product-info .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.product-meta-item {
    display: flex;
    align-items: center;
    color: #6b7280;
}

.product-meta-item i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-price {
    font-weight: 600;
    font-size: 1.125rem;
}

/* Checkout */
.checkout-section .card {
    border: 1px solid #e5e7eb;
}

.payment-method {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-method:hover,
.payment-method.active {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

/* Notifications */
.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f9fafb;
}

.notification-item.unread {
    background-color: #eff6ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

/* License Card */
.license-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.license-key {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* File Upload */
.file-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-upload-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.file-upload-zone i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .product-card .card-img-top {
        height: 150px;
    }
    
    .dashboard-sidebar {
        min-height: auto;
    }
}

/* Print Styles */
@media print {
    .navbar, .footer, .btn {
        display: none !important;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip Customization */
.tooltip {
    font-size: 0.75rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow-lg);
}

/* Rating Stars */
.rating-stars {
    color: #fbbf24;
}

.rating-stars .far {
    color: #d1d5db;
}

/* Code Preview */
.code-preview {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
