/* ============================================
   BOTTOM NAVIGATION (Mobile App Style)
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active {
    color: var(--primary-color, #10BFFF);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary-color, #10BFFF);
    border-radius: 0 0 3px 3px;
}

.bottom-nav-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Hide on desktop, show only on mobile */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* Adjust content padding when bottom nav is visible */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    
    .main-content,
    .dashboard-container {
        padding-bottom: 80px;
    }
}

/* Dark mode support */
[data-theme="dark"] .bottom-nav {
    background: var(--bg-secondary, #1f2937);
    border-top-color: var(--border-color, #374151);
}

/* ============================================
   REUSABLE BADGE COMPONENTS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    line-height: 1;
}

.badge.badge-primary {
    background-color: rgba(79, 70, 229, 0.1);
    color: #10BFFF;
}

.badge.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge.badge-warning {
    background-color: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.badge.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge.badge-secondary {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Dark mode badges */
[data-theme="dark"] .badge.badge-primary {
    background-color: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

[data-theme="dark"] .badge.badge-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

[data-theme="dark"] .badge.badge-warning {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .badge.badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

[data-theme="dark"] .badge.badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* ============================================
   SIDEBAR EXTERNAL LINK STYLES
   ============================================ */

.nav-item.external-link {
    position: relative;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-left: 3px solid #10BFFF;
}

.nav-item.external-link:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.nav-item.external-link i:last-child {
    opacity: 0.5;
    transition: all 0.2s ease;
}

.nav-item.external-link:hover i:last-child {
    opacity: 1;
    transform: translateX(4px);
}

/* Marketplace section highlight */
.nav-section:has(.nav-item[href="/marketplace"]) {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02) 0%, rgba(99, 102, 241, 0.02) 100%);
    border-radius: 8px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.nav-section:has(.nav-item[href="/marketplace"]) .nav-section-title {
    color: #10BFFF;
    font-weight: 600;
}

/* Dark mode support */
[data-theme="dark"] .nav-item.external-link {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-left-color: #6366f1;
}

[data-theme="dark"] .nav-section:has(.nav-item[href="/marketplace"]) {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
}

[data-theme="dark"] .nav-section:has(.nav-item[href="/marketplace"]) .nav-section-title {
    color: #818cf8;
}

/* ============================================
   ANIMATION UTILITIES
   ============================================ */

.animate-in {
    animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   TABLE ENHANCEMENTS FOR MARKETPLACE
   ============================================ */

.table-container .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.table-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Dark mode table support */
[data-theme="dark"] .table-container {
    background-color: transparent;
}

[data-theme="dark"] .table-title {
    color: #f9fafb;
}

/* ============================================
   FORM SELECT FIX FOR PLACEHOLDER CUTOFF
   ============================================ */

select.form-select,
select.form-control {
    padding-right: 2.5rem !important;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Ensure proper height for all select elements */
select.form-select,
select.form-control {
    min-height: 42px;
    line-height: 1.5;
}

/* Fix for select dropdown arrow */
select.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
}

[data-theme="dark"] select.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%239ca3af' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: #10BFFF;
    color: white;
}

.btn-primary:hover {
    background-color: #0EA5E9;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: #10BFFF;
    color: #10BFFF;
}

.btn-outline-primary:hover {
    background-color: #10BFFF;
    color: white;
}

/* ============================================
   LOADING & SKELETON STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 200px;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Dark mode skeletons */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-desktop {
        display: block !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-primary {
    color: var(--primary-color, #10BFFF);
}

.text-secondary {
    color: var(--text-secondary, #6b7280);
}

.text-success {
    color: #10b981;
}

.text-danger {
    color: #ef4444;
}

.text-warning {
    color: #f59e0b;
}

.text-muted {
    color: var(--text-secondary, #9ca3af);
}

.fw-bold {
    font-weight: 700;
}

.fw-semibold {
    font-weight: 600;
}

.fw-normal {
    font-weight: 400;
}

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}


/* ============================================
   SEARCH BAR FIX - MARKETPLACE HEADER
   ============================================ */

/* Fix search bar alignment and styling */
.marketplace-header {
    margin-bottom: 2rem;
    width: 100%;
}

.marketplace-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    width: 100%;
}

/* Search input wrapper */
.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #9ca3af);
    pointer-events: none;
    z-index: 1;
    font-size: 1rem;
}

.search-input-wrapper .search-input,
.marketplace-search .search-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    font-size: 0.95rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    background-color: var(--bg-secondary, #f9fafb);
    transition: all 0.2s ease;
    color: var(--text-primary, #1f2937);
    outline: none;
}

.search-input-wrapper .search-input::placeholder,
.marketplace-search .search-input::placeholder {
    color: var(--text-secondary, #9ca3af);
    opacity: 0.7;
}

.search-input-wrapper .search-input:focus,
.marketplace-search .search-input:focus {
    border-color: var(--marketplace-primary, #10BFFF);
    background-color: var(--bg-primary, #ffffff);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Create listing button */
.marketplace-search .btn {
    height: 48px;
    padding: 0 1.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* ============================================
   DARK MODE - SEARCH BAR
   ============================================ */

[data-theme="dark"] .search-input-wrapper .search-input,
[data-theme="dark"] .marketplace-search .search-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

[data-theme="dark"] .search-input-wrapper .search-input::placeholder,
[data-theme="dark"] .marketplace-search .search-input::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

[data-theme="dark"] .search-input-wrapper .search-icon {
    color: #9ca3af;
}

[data-theme="dark"] .search-input-wrapper .search-input:focus,
[data-theme="dark"] .marketplace-search .search-input:focus {
    background-color: #1f2937;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .marketplace-search {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .marketplace-search .btn {
        width: 100%;
    }
}