/**
 * Base CSS for NCR Claim System - Bootstrap 5
 * Shared styles used across all modules
 */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #006633;
    --primary-dark: #004d26;
    --primary-light: #e6f0eb;
    --bg-color: #f4f6f8;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --success: #16a34a;
    --success-light: #dcfce7;
    --info: #0891b2;
    --info-light: #cffafe;
    --orange: #f97316;
    --orange-light: #fff7ed;
    --border-color: #e5e7eb;
    --sidebar-width: 260px;
    --card-radius: 16px;
    --transition-speed: 0.2s;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    font-family: 'Prompt', 'Inter', sans-serif;
}

html,
body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT STYLES
   ============================================ */

.main-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

.main-content {
    flex: 1;
    margin-left: 290px;
    padding: 2rem;
    transition: margin-left var(--transition-speed);
    min-width: 0;
    max-width: 100%;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

#sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--white);
    height: calc(100vh - 30px);
    position: fixed;
    left: 15px;
    top: 15px;
    border-right: 1px solid var(--border-color);
    border-radius: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.sidebar-top {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.025em;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 16px 12px;
    margin: 0;
    overflow-y: auto;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    gap: 12px;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-link:hover {
    background-color: var(--bg-color);
    color: var(--text-dark);
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 102, 51, 0.2);
}

.sidebar-link.active:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #003d1f 100%);
}

.sidebar-bottom {
    border-top: 1px solid var(--border-color);
    padding: 0;
    margin-top: auto;
}

.user-name {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 20px;
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 0 0 16px 16px;
}

.logout-btn:hover {
    background-color: var(--danger-light);
    color: #991b1b;
}

.logout-btn i {
    font-size: 1rem;
}

/* ============================================
   COMPONENT STYLES
   ============================================ */

/* Cards */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 12px;
    background-color: #f8fafb;
}

/* Stat Card Variants */
.stat-card.primary {
    border-top: 4px solid var(--primary-color);
}

.stat-card.primary .stat-title {
    color: var(--primary-color);
}

.stat-card.primary .stat-icon {
    color: var(--primary-color);
}

.stat-card.warning {
    border-top: 4px solid var(--warning);
}

.stat-card.warning .stat-title {
    color: var(--warning);
}

.stat-card.warning .stat-icon {
    color: var(--warning);
}

.stat-card.info {
    border-top: 4px solid var(--info);
}

.stat-card.info .stat-title {
    color: var(--info);
}

.stat-card.info .stat-icon {
    color: var(--info);
}

.stat-card.success {
    border-top: 4px solid var(--success);
}

.stat-card.success .stat-title {
    color: var(--success);
}

.stat-card.success .stat-icon {
    color: var(--success);
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: block;
}

/* Tables */
.table {
    color: var(--text-dark);
}

.table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid var(--border-color);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--primary-light);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    transition: all var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 51, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    position: relative;
    z-index: 1;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.alert-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.alert-info {
    background-color: var(--info-light);
    color: var(--info);
}

/* Modals */
.modal-content {
    border-radius: var(--card-radius);
    border: none;
    box-shadow: var(--shadow-soft);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* ============================================
   UTILITY STYLES
   ============================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Purple Theme for Store */
.text-purple {
    color: #8b5cf6 !important;
}

.bg-purple {
    background-color: #8b5cf6 !important;
    color: white;
}

.bg-purple-subtle {
    background-color: #f3e8ff !important;
    color: #7e22ce !important;
}

.border-purple {
    border-color: #8b5cf6 !important;
}

.btn-outline-purple {
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.btn-outline-purple:hover {
    background-color: #8b5cf6;
    color: white;
}

.btn-purple {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
}

.btn-purple:hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

.text-muted {
    color: var(--text-muted) !important;
}

.bg-light {
    background-color: #f9fafb !important;
}

.border {
    border: 1px solid var(--border-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.rounded {
    border-radius: 8px !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap {
    white-space: normal !important;
}

.text-break {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.align-items-center {
    align-items: center !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.small {
    font-size: 0.875rem !important;
}

.opacity-25 {
    opacity: 0.25 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

/* Margins & Paddings */
.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 0.25rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.p-5 {
    padding: 3rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.h-100 {
    height: 100% !important;
}

/* ============================================
   PROJECT SPECIFIC: NCR CLAIM FORM
   ============================================ */

/* NCR Specific Cards */
.ncr-card {
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease;
    background: var(--white);
}

.ncr-card:hover {
    transform: translateY(-2px);
}

/* Headers */
.ncr-card-header {
    background: #f1f5f9;
    /* Light gray background */
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 20px;
    color: #111827 !important;
    /* Force black text */
    font-weight: 600;
    display: flex;
    align-items: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.ncr-card-header *,
.ncr-card-header h1,
.ncr-card-header h2,
.ncr-card-header h3,
.ncr-card-header h4,
.ncr-card-header h5,
.ncr-card-header h6 {
    color: #111827 !important;
}

.ncr-header-gray {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 25px;
}

.ncr-header-blue {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    color: #0369a1;
}

/* Utilities for Collapsible Cards */
.cursor-pointer {
    cursor: pointer;
}

.transition-icon {
    transition: transform var(--transition-speed);
}

.rotate-180 {
    transform: rotate(180deg);
}

.ncr-header-orange {
    background: #fffbeb;
    border-bottom: 1px solid #fed7aa;
    padding: 20px 25px;
    color: #b45309;
}

/* Section Titles */
.ncr-section-title,
.section-title-alt {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 30px 0 20px 0;
    display: flex;
    align-items: center;
}

/* Form Elements */
.ncr-form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

.glass-input {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.ncr-readonly-field {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    display: block;
    background-color: #f8fafc;
    color: #475569;
    min-height: 45px;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: #f0fdf4;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

/* Link Inputs */
.link-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.link-input-group .btn-add {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-dark);
    border-radius: 8px;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.link-input-group .btn-add:hover {
    background: #e2e8f0;
    color: var(--primary-color);
}

/* File Previews */
.preview-item {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

.preview-del-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    transition: all 0.2s ease;
}

.preview-del-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: #f8fafc;
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Requester Card */
.requester-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-circle {
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Form Grids */
.form-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Sticky Action Bar */
/* Sticky Action Bar */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 290px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

/* Purchase Process Specific Styles */
.text-primary-dark {
    color: #1e3a8a;
}

.text-gray-dark {
    color: #374151;
}

.claim-result-card {
    border-left: 5px solid var(--info);
}

.claim-result-header {
    color: var(--info);
    background: var(--white);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Hide sidebar on small screens */
@media (max-width: 991.98px) {
    #sidebar-container {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .sticky-action-bar {
        left: 0;
    }
}

/* Sidebar responsive */
@media (max-width: 768px) {
    #sidebar-container {
        transform: translateX(-100%);
        left: 0;
    }

    #sidebar-container.active {
        transform: translateX(0);
    }
}

/* Form Grid & Sticky Bar responsive */
@media (max-width: 768px) {

    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .sticky-action-bar {
        flex-direction: column;
        gap: 10px;
    }

    .sticky-action-bar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background-color: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   RESPONSIVE SIDEBAR (Icon-only on small screens)
   ============================================ */
@media (max-width: 768px) {

    /* Responsive Sidebar Container */
    .sidebar-responsive {
        width: 4.5rem !important;
        /* Force width */
        overflow-x: hidden;
        transition: width 0.3s ease;
    }

    /* Hide text labels */
    .sidebar-responsive .sidebar-text,
    .sidebar-responsive .dropdown-toggle strong,
    .sidebar-responsive .dropdown-item-text {
        display: none !important;
    }

    /* Adjust Main Content & Logo */
    .sidebar-responsive .fs-4 {
        display: none !important;
    }

    /* Center Icons */
    .sidebar-responsive .nav-link,
    .sidebar-responsive .d-flex {
        justify-content: center !important;
        text-align: center;
    }

    .sidebar-responsive .nav-link i {
        margin-right: 0 !important;
        /* Remove margin added by me-2 */
        font-size: 1.2rem;
    }

    .sidebar-responsive .dropdown-toggle {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .sidebar-responsive .dropdown-menu {
        position: absolute !important;
        left: 100% !important;
        /* Show dropdown to the right */
        top: 0 !important;
        margin-left: 0.5rem;
    }

    /* Update Main Content Margin */
    .main-content {
        margin-left: 4.5rem !important;
        /* Match new sidebar width */
    }

    /* Adjust Logo Container */
    .sidebar-responsive a.text-decoration-none {
        justify-content: center !important;
        padding: 0 !important;
    }

    .sidebar-responsive img {
        margin-right: 0 !important;
    }

    /* Adjust Sticky Bar for Icon Sidebar */
    .sticky-action-bar {
        left: 4.5rem;
    }
}