/* Professional Product Take-Back Portal - Resale Manager Style */

/* Typography and Base Styles */
:root {
    --primary-color: #446930;
    --primary-dark: #446930;
    --primary-light: #446930;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #a0aec0;
    --sidebar-text-hover: #ffffff;
    --sidebar-border: #2d2d3f;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f3f4f6;
    color: #111827;
    line-height: 1.6;
}

/* Modern Navigation */
.navbar {
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-weight: 700;
    color: var(--dark-color) !important;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1;
    margin-top: -2px;
}



/* Clean layout without sidebar */

/* Modern Dark Sidebar - Resale Manager Style - Full Height */
.sidebar-wrapper {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    z-index: 1000;
}

.sidebar-bg,
.col-xl-2.sidebar-bg,
.col-lg-3.sidebar-bg,
.col-md-3.sidebar-bg {
    background-color: var(--sidebar-bg) !important;
    border-right: none !important;
}

.sidebar,
.d-md-block.sidebar {
    height: 100vh !important;
    width: 240px;
    background-color: var(--sidebar-bg) !important;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--sidebar-border);
    background-color: var(--sidebar-bg) !important;
}

.sidebar-sticky {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--sidebar-bg) !important;
    padding-top: 1rem;
}

.main-content-wrapper {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Responsive adjustments for mobile/tablet */
@media (max-width: 767px) {
    .sidebar-wrapper {
        display: none;
    }

    .main-content-wrapper {
        margin-left: 0 !important;
    }

    .search-wrapper .input-group {
        max-width: 100%;
    }
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-content {
    flex: 1;
    background-color: #f3f4f6;
}

.search-wrapper .input-group {
    max-width: 500px;
}

.search-wrapper .form-control {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.search-wrapper .form-control:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    border-color: var(--primary-color);
}

.search-wrapper .input-group-text {
    border: 1px solid #e5e7eb;
    border-radius: 8px 0 0 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.sidebar-sticky .border-bottom {
    border-color: var(--sidebar-border) !important;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 5px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 10px;
}

.sidebar-nav,
.sidebar .nav,
.sidebar ul,
.sidebar .nav-item {
    padding: 0 0.75rem;
    background-color: transparent !important;
}

.sidebar .nav-item {
    padding: 0 !important;
}

.sidebar-link {
    color: var(--sidebar-text) !important;
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0 !important;
    border-radius: 8px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border: none !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    background-color: transparent !important;
}

.sidebar-link:hover {
    background-color: rgba(124, 58, 237, 0.15) !important;
    color: var(--sidebar-text-hover) !important;
}

.sidebar-link.active {
    background-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
}

.sidebar-heading {
    font-size: 0.6875rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--sidebar-text) !important;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.sidebar-section-divider {
    height: 1px;
    background-color: var(--sidebar-border) !important;
    margin: 1.5rem 0;
}

.sidebar .sidebar-text {
    color: var(--sidebar-text);
}

.sidebar-brand-text {
    color: var(--sidebar-text) !important;
    font-size: 1.25rem;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.sidebar-toggle-btn {
    color: var(--sidebar-text) !important;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-toggle-btn:hover {
    opacity: 1;
    color: var(--sidebar-text-hover) !important;
}

.sidebar-toggle-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Collapsed Sidebar State */
.sidebar-wrapper.collapsed {
    width: 70px;
}

.sidebar-wrapper.collapsed .sidebar {
    width: 70px;
}

.sidebar-wrapper.collapsed .sidebar-header > div {
    padding: 0.5rem !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.sidebar-wrapper.collapsed .sidebar-header a {
    gap: 0 !important;
}

.sidebar-wrapper.collapsed .sidebar-brand-text,
.sidebar-wrapper.collapsed .sidebar-text {
    display: none;
}

.sidebar-wrapper.collapsed .sidebar-logo {
    height: 32px !important;
    width: auto !important;
}

.sidebar-wrapper.collapsed .sidebar-toggle-btn {
    position: static;
    transform: none;
}

.sidebar-wrapper.collapsed .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0.5rem !important;
}

.sidebar-wrapper.collapsed .sidebar-link i {
    margin-right: 0 !important;
}

.sidebar-wrapper.collapsed .sidebar-heading,
.sidebar-wrapper.collapsed .sidebar-section-divider {
    display: none;
}

.sidebar-wrapper.collapsed + .main-content-wrapper {
    margin-left: 70px;
}

.sidebar-header {
    position: relative;
}

/* Smooth transitions */
.sidebar-wrapper,
.sidebar,
.main-content-wrapper,
.sidebar-brand-text,
.sidebar-text {
    transition: all 0.3s ease;
}

/* Modern Process Steps */
.process-step {
    padding: 2rem 1rem;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateY(-8px);
}

.process-icon {
    position: relative;
    margin: 0 auto;
}

.step-number {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

/* Trade process steps for internal pages */
.trade-steps {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step-circle.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
}

.step-circle.completed {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 0.5rem;
}

.step-line.completed {
    background: var(--success-color);
}

/* Modern Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

/* File upload area */
.file-upload-area {
    border: 2px dashed #6c757d;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.file-upload-area:hover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.file-upload-area.dragover {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

/* Status badges */
.status-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
}

/* Dashboard charts */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

/* Modern Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

.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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section .lead {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Feature Cards in Hero */
.feature-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: white;
}

/* Modern Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    background: transparent;
}

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

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

.btn-light:hover {
    background: #f8fafc;
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Navigation active states */
.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Enhanced Form Styling */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

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

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

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

/* CSV Preview Styles */
.csv-preview-container {
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    margin-top: 1rem;
}

.csv-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.csv-stats {
    display: flex;
    gap: 0.5rem;
}

.validation-summary {
    margin-top: 1rem;
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.validation-issues ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.validation-issues li {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.validation-score {
    font-weight: 600;
}

.column-mapping {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.column-mapping .card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.column-mapping .card:hover {
    border-color: #0d6efd;
    transform: translateY(-1px);
}

.mapping-controls select {
    width: 100%;
    font-size: 0.875rem;
}

.data-preview {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-preview .table {
    margin-bottom: 0;
}

.data-preview .table th {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    font-size: 0.8rem;
    white-space: nowrap;
}

.data-preview .table td {
    font-size: 0.875rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.5rem;
}

.data-preview .table-warning {
    background-color: rgba(255, 193, 7, 0.1);
}

.csv-preview-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.csv-preview-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.badge-warning {
    background-color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

.badge-info {
    background-color: var(--info-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .sidebar-sticky {
        height: auto;
        position: static;
    }

    .step-indicator {
        flex-direction: column;
    }

    .step-line {
        width: 2px;
        height: 2rem;
        margin: 0.5rem 0;
    }

    .hero-section {
        padding: 3rem 0 !important;
    }

    .hero-section h1 {
        font-size: 2rem !important;
    }

    .feature-card {
        padding: 1.5rem 1rem;
    }

    .process-step {
        padding: 1.5rem 0.5rem;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
}

/* Identification Cards */
.identification-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.identification-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.identification-card.border-primary {
    border-color: var(--primary-color) !important;
}

/* Type-ahead Suggestions */
.suggestion-item {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    transition: background-color 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: var(--primary-color);
    color: white;
}

.suggestion-item:focus {
    outline: none;
    background-color: var(--primary-color);
    color: white;
}

/* Serial Number Lookup */
.input-group .btn {
    border-left: none;
}

.input-group .form-control:focus + .btn {
    border-color: var(--primary-color);
}

@media (max-width: 992px) {
    .sidebar-text {
        font-size: 0.85rem;
    }

    .sidebar {
        max-width: 200px;
        min-width: 180px;
    }
}

/* Mobile navigation improvements */
@media (max-width: 767px) {
    .sidebar {
        display: none !important;
    }

    .offcanvas-body .nav-link {
        padding: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .offcanvas-body .nav-link:hover {
        background-color: rgba(0, 123, 255, 0.1);
    }
}

/* Sidebar active states */
.sidebar .nav-link.active,
.offcanvas-body .nav-link.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff !important;
    font-weight: 500;
}

/* Notification Positioning - Prevent overlap with content */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
}

/* CSV Format Info - Completely non-dismissible permanent display */
.csv-format-permanent-info {
    position: relative !important;
    z-index: 999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 1rem !important;
    border-left: 4px solid var(--primary-color) !important;
    background-color: rgba(37, 99, 235, 0.05) !important;
}

.csv-format-permanent-info h6 {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* Ensure no JavaScript can hide this element */
.csv-format-permanent-info[style*="display: none"] {
    display: block !important;
}

.csv-format-permanent-info[style*="visibility: hidden"] {
    visibility: visible !important;
}

.csv-format-permanent-info[style*="opacity: 0"] {
    opacity: 1 !important;
}