/* ===================================
   eBay Listing Manager - Main Styles
   =================================== */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --sidebar-bg: #1f2937;
    --sidebar-text: #f3f4f6;
    --content-padding: 2rem;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
    background-color: #f3f4f6;
}

/* Email Verification Banner */
.email-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.75rem 0;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
}


.email-banner ~ .sidebar {
    top: 3rem;
    height: calc(100vh - 3rem);
}

.email-banner ~ .main-content {
    margin-top: 3rem;
}

/* Ghost Mode Banner - Compact */
.ghost-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.4rem 0;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
}

.ghost-banner .btn-sm {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
}

.ghost-banner ~ .sidebar {
    top: 2rem;
    height: calc(100vh - 2rem);
}

.ghost-banner ~ .main-content {
    margin-top: 2rem;
}

/* Sync Status Bar - ONLY shows when syncing */
.sync-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
}

.sync-status-bar .btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* When sync bar is visible, adjust layout */
.sync-status-bar[style*="display: block"] ~ .sidebar {
    top: 60px;
    height: calc(100vh - 60px);
}

.sync-status-bar[style*="display: block"] ~ .main-content {
    margin-top: 60px;
}

/* Ghost banner removed */

/* ===================================
   Sidebar Navigation
   =================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar collapse feature removed */

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    flex: 1;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.875rem;
    font-weight: 400;
}

.nav-link:hover {
    background-color: rgba(99, 102, 241, 0.1);
    padding-left: 1.25rem;
    color: #e5e7eb;
}

.nav-link.active {
    background-color: rgba(99, 102, 241, 0.2);
    border-left: 3px solid #6366f1;
    color: #fff;
}

.nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: #9ca3af;
}

.nav-link.active i,
.nav-link:hover i {
    color: #818cf8;
}

/* Navigation Sections */
.nav-section {
    margin: 0.25rem 0;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    user-select: none;
    position: relative;
    z-index: 1;
}

.nav-section-header:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: #d1d5db;
}

.nav-section-header.active {
    color: #e5e7eb;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.nav-section-title i {
    font-size: 0.85rem;
    color: #6366f1;
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: #9ca3af;
}

.nav-section-header.active .toggle-icon {
    transform: rotate(180deg);
    color: #6366f1;
}

/* Submenu */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.15);
}

.nav-submenu.show {
    max-height: 500px;
}

.nav-submenu .nav-link {
    padding-left: 2.5rem;
    font-size: 0.875rem;
    color: #d1d5db;
}

.nav-submenu .nav-link:hover {
    padding-left: 2.75rem;
    background-color: rgba(99, 102, 241, 0.15);
    color: #e5e7eb;
}

.nav-submenu .nav-link.active {
    background-color: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-left: 3px solid #6366f1;
}

.nav-submenu .nav-link i {
    font-size: 0.85rem;
    color: #9ca3af;
}

.nav-submenu .nav-link.active i,
.nav-submenu .nav-link:hover i {
    color: #818cf8;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar-footer {
    margin-top: auto;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* ===================================
   Main Content Area
   =================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-color);
    transition: margin-left 0.3s ease;
}


/* Top-bar and content-wrapper removed - using direct container-fluid */

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container-fluid {
    padding: var(--content-padding);
}

/* ===================================
   Cards & Panels
   =================================== */
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.15;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0;
    color: #111827;
}

.stat-card .stat-label {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h5, .card-header h6 {
    color: var(--dark-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-custom {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

/* ===================================
   Tables
   =================================== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
}

table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

/* ===================================
   Forms
   =================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 100, 210, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-color);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
}

.btn-primary, .btn-primary-custom {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover, .btn-primary-custom:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-warning {
    color: #fff;
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

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

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
}

.btn-outline-secondary {
    color: #6b7280;
    border-color: #d1d5db;
    background-color: #fff;
}

.btn-outline-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ===================================
   Badges
   =================================== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
}

.badge.bg-success, .badge-success {
    color: #fff;
    background-color: #10b981;
}

.badge.bg-warning, .badge-warning {
    color: #92400e;
    background-color: #fef3c7;
}

.badge.bg-danger, .badge-danger {
    color: #fff;
    background-color: #ef4444;
}

.badge.bg-info, .badge-info {
    color: #fff;
    background-color: #3b82f6;
}

.badge.bg-secondary, .badge-secondary {
    color: #fff;
    background-color: #6b7280;
}

.badge-custom {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
}

/* ===================================
   Alerts
   =================================== */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* ===================================
   Pagination
   =================================== */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 4px;
}

.page-item {
    margin: 0 2px;
}

.page-link {
    padding: 0.5rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.page-link:hover {
    background-color: #e9ecef;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #fff;
}

/* ===================================
   Image Upload Area
   =================================== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    background-color: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(0, 100, 210, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.image-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-item .image-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.image-item .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.image-info {
    padding: 0.5rem;
    font-size: 0.75rem;
    background: #f8f9fa;
}

/* ===================================
   Loading Spinner
   =================================== */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay .spinner {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

/* ===================================
   Modal
   =================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-dialog {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ===================================
   Utility Classes
   =================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: #6c757d; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --content-padding: 1rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}