/* Custom CSS for MJ BUTIAMA PHARMACY */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* General Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    border: none;
    color: #000;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    padding: 0.75rem;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    transform: scale(1.01);
}

/* Badges */
.badge {
    border-radius: 50px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow-lg);
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
}

.dashboard-card.sales {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.dashboard-card.stock {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dashboard-card.profit {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.dashboard-card.customers {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-1px);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 3rem;
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* Stock Status Indicators */
.stock-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stock-status.in-stock {
    background-color: #d1edff;
    color: #0c63e4;
}

.stock-status.low-stock {
    background-color: #fff3cd;
    color: #856404;
}

.stock-status.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

/* Advanced Loading System */

/* Global Loading Overlay */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.global-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.95) 0%, rgba(8, 66, 152, 0.95) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-container {
    text-align: center;
    color: white;
    animation: fadeInUp 0.6s ease-out;
}

/* Pharmacy-themed Spinner */
.pharmacy-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.pill-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
}

.pill {
    position: absolute;
    width: 16px;
    height: 8px;
    background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    border-radius: 8px;
    animation: pillRotate 2s linear infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pill-1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.pill-2 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 0.5s;
}

.pill-3 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1s;
}

.pill-4 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation-delay: 1.5s;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring-2 {
    animation-delay: 0.7s;
    width: 100px;
    height: 100px;
}

.pulse-ring-3 {
    animation-delay: 1.4s;
    width: 120px;
    height: 120px;
}

/* Loader Text */
.loader-text h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.loader-text p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    animation: textPulse 2s ease-in-out infinite;
}

/* Progress Bar */
.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #e3f2fd 50%, #ffffff 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressShine 2s ease-in-out infinite;
}

/* Page Loading Bar */
.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9998;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-loading-bar.active {
    opacity: 1;
}

.loading-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 50%, #0a58ca 100%);
    width: 0%;
    animation: loadingBarAnimation 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

/* Small Inline Spinners */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(13, 110, 253, 0.2);
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Button Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Card Loading Skeleton */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pillRotate {
    0% {
        transform: rotate(0deg) translateX(25px) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        transform: rotate(360deg) translateX(25px) rotate(-360deg);
        opacity: 1;
    }
}

@keyframes pulseRing {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes progressShine {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

@keyframes loadingBarAnimation {
    0% {
        width: 0%;
        left: 0%;
    }
    50% {
        width: 50%;
        left: 25%;
    }
    100% {
        width: 0%;
        left: 100%;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes skeletonLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: 200px 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .loading-skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pharmacy-spinner {
        width: 80px;
        height: 80px;
    }

    .pill-spinner {
        width: 40px;
        height: 40px;
    }

    .pill {
        width: 12px;
        height: 6px;
    }

    .pulse-ring {
        width: 60px;
        height: 60px;
    }

    .pulse-ring-2 {
        width: 75px;
        height: 75px;
    }

    .pulse-ring-3 {
        width: 90px;
        height: 90px;
    }

    .loader-text h4 {
        font-size: 1.25rem;
    }

    .progress-bar {
        width: 150px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Modern Footer Styles */
.modern-footer {
    position: relative;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 25%, #0a58ca 50%, #084298 75%, #052c65 100%);
    color: white;
    margin-top: auto;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(13, 110, 253, 0.3);
}

/* Animated Wave Effect */
.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.footer-wave .shape-fill {
    fill: #f8f9fa;
}

/* Footer Content */
.footer-content {
    position: relative;
    z-index: 2;
    padding: 4rem 0 2rem;
}

/* Brand Section */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInLeft 0.8s ease-out;
}

.brand-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(13, 110, 253, 0.2);
}

.brand-icon i {
    font-size: 2rem;
    color: #ffffff;
}

.brand-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}

/* Stats Section */
.footer-stats {
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item:hover {
    transform: translateX(5px);
    background: rgba(13, 110, 253, 0.15);
    border-radius: 8px;
    padding-left: 1rem;
    box-shadow: 0 2px 15px rgba(13, 110, 253, 0.2);
}

.stat-item i {
    font-size: 1.2rem;
    color: #ffffff;
    width: 20px;
    text-align: center;
}

.stat-item span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Developer Section */
.footer-developer {
    animation: slideInRight 0.8s ease-out 0.4s both;
}

.developer-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(13, 110, 253, 0.25);
    text-align: center;
    transition: all 0.3s ease;
}

.developer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(13, 110, 253, 0.4);
}

.developer-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.developer-avatar i {
    font-size: 2rem;
    color: #0d6efd;
}

.developer-label {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.developer-name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.copyright {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}


/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure footer stays at bottom */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 992px) {
    .footer-content {
        padding: 3rem 0 1.5rem;
    }

    .developer-card {
        margin-top: 2rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .footer-wave svg {
        height: 40px;
    }

    .footer-content {
        padding: 2rem 0 1rem;
    }

    .footer-brand {
        justify-content: center;
        text-align: center;
    }

    .brand-icon {
        width: 50px;
        height: 50px;
    }

    .brand-icon i {
        font-size: 1.5rem;
    }

    .brand-title {
        font-size: 1.25rem;
    }

    .footer-stats {
        margin-top: 2rem;
    }

    .developer-avatar {
        width: 60px;
        height: 60px;
    }

    .developer-avatar i {
        font-size: 1.5rem;
    }
}


/* Print styles for footer */
@media print {
    .modern-footer {
        display: none !important;
    }
}