/* Main Stylesheet for Pharmacy POS */

/* Custom Variables */
:root {
    --primary-color: #5c67f2;
    --primary-light: rgba(92, 103, 242, 0.1);
    --secondary-color: #1a1b23;
    --accent-color: #00d2ff;
    --success-color: #00c9a7;
    --danger-color: #ff6b6b;
    --warning-color: #feb139;
    --info-color: #4facfe;
    --light-bg: #f4f7fe;
    --card-bg: #ffffff;
    --sidebar-bg: #1a1b23;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #e9ecef;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base Adjustments */
body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 111, 165, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2ecc71 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d35400 100%);
    border: none;
}

/* Table Styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8f9fa;
    color: var(--secondary-color);
    font-weight: 600;
    border-top: 1px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 15px;
}

.table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-top: 1px solid #e0e0e0;
}

.table-hover tbody tr:hover {
    background-color: rgba(74, 111, 165, 0.05);
}

/* Badge Styles */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #2ecc71 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f1c40f 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c0392b 100%) !important;
}

/* Form Styles */
.form-control,
.form-select {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px 15px;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 111, 165, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 10px 10px 0 0;
    padding: 20px;
}

.modal-title {
    color: white;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

.bg-danger {
    background-color: var(--danger-color) !important;
}

.bg-warning {
    background-color: var(--warning-color) !important;
}

.bg-info {
    background-color: var(--info-color) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .table {
        border: 1px solid #ddd !important;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Status Indicators */
.status-active {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--success-color);
    margin-right: 5px;
}

.status-inactive {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 5px;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

/* Enhanced Stat Cards */
.insight-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.insight-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.insight-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.insight-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.insight-card:hover .insight-icon {
    transform: scale(1.1);
}

.insight-title {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.insight-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.trend-indicator {
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

/* Modern Sidebar Redesign */
.sidebar {
    background: var(--sidebar-bg);
    width: 280px;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 24px !important;
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 15px !important;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.nav-category {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 25px 24px 10px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    margin: 4px 8px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    opacity: 0.7;
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c83fd 100%);
    color: white;
    box-shadow: 0 8px 15px rgba(92, 103, 242, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active i {
    opacity: 1;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    height: 30px;
    width: 4px;
    background: white;
    border-radius: 0 4px 4px 0;
}

.sidebar-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px !important;
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.85rem;
}

.user-info-text {
    overflow: hidden;
}

.user-name {
    display: block;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

/* Scroll Adjustment */
.main-content {
    margin-left: 280px;
}


/* Modern Navbar */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 24px;
}

/* Table Enhancements */
.table-modern {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-modern thead th {
    background: #f8faff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 16px 20px;
}

.table-modern tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Professional Tints */
.bg-primary-light {
    background: rgba(92, 103, 242, 0.1) !important;
}

.bg-success-light {
    background: rgba(0, 201, 167, 0.1) !important;
}

.bg-warning-light {
    background: rgba(254, 177, 57, 0.1) !important;
}

.bg-danger-light {
    background: rgba(255, 107, 107, 0.1) !important;
}

.bg-info-light {
    background: rgba(79, 172, 254, 0.1) !important;
}

/* Action Center */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-item {
    background: white;
    border-radius: 20px;
    padding: 30px 24px;
    text-align: center;
    text-decoration: none !important;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.action-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 15px 30px rgba(92, 103, 242, 0.1);
}

.action-item i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.action-item:hover i {
    transform: scale(1.1);
}

.action-item h4 {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.action-item:hover h4 {
    color: var(--primary-color);
}

.action-item span.btn {
    transition: all 0.3s ease;
}

.action-item:hover span.btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}


/* Professional Layout - Ensuring proper spacing and fixed positioning */
body {
    overflow-y: scroll;
    /* Ensure scrollbar is always visible to prevent jump */
}

.main-content {
    background: #f8faff;
    /* Slightly different shade for main content area */
}

/* Sidebar Refinements */
.sidebar {
    height: 100vh;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navbar Polish */
.navbar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-box {
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: white !important;
    box-shadow: 0 4px 12px rgba(92, 103, 242, 0.1);
}

.nav-item .btn-light {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-item .btn-light:hover {
    background: var(--primary-light) !important;
    color: var(--primary-color) !important;
}

.nav-item .btn-light:hover i {
    color: var(--primary-color) !important;
}

/* Avatar Box */
.avatar-box {
    transition: transform 0.2s;
}

.nav-link:hover .avatar-box {
    transform: scale(1.05);
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        padding-top: var(--top-nav-height);
    }
}

/* Category Label Polish */
.nav-category {
    margin-top: 30px;
    padding-left: 20px;
}

/* Icon Polish */
.sidebar .nav-link i {
    min-width: 25px;
}