/* Valley Diagnostics - Medical Lab Testing Platform Styles */

/* Color Variables */
:root {
    --valley-primary: #6f42c1;
    --valley-secondary: #20c997;
    --valley-light: #e8f4f8;
    --valley-dark: #2c3e50;
    --valley-gray: #6c757d;
    --valley-background: #f8f9fa;
    --valley-accent: #ff6b35;
    --valley-success: #28a745;
    --valley-warning: #ffc107;
    --valley-danger: #dc3545;
    --valley-info: #17a2b8;
}

/* Typography */
body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--valley-background);
    color: var(--valley-dark);
    line-height: 1.6;
}

/* Disable ALL Bootstrap Animations */
*, *::before, *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* Modal Improvements - Zero Animation */
.modal {
    transition: none !important;
    animation: none !important;
}

.modal-dialog {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

.modal-backdrop {
    transition: none !important;
    animation: none !important;
    opacity: 0.5 !important;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: none !important;
    animation: none !important;
}

/* Force disable fade class behavior */
.fade {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
}

.fade:not(.show) {
    opacity: 0 !important;
}

.fade.show {
    opacity: 1 !important;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Button hover improvements */
.btn[data-bs-toggle="modal"] {
    transition: all 0.2s ease;
}

.btn[data-bs-toggle="modal"]:hover {
    transform: translateY(-1px);
}

/* Cookie Consent Banner (CCPA Compliance) */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 1.25rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

.cookie-consent p {
    color: white;
    line-height: 1.6;
}

.cookie-consent a {
    color: white;
    text-decoration: underline;
}

.cookie-consent .btn-light {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.cookie-consent .btn-outline-light {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Valley Brand Colors */
.bg-valley-primary {
    background-color: var(--valley-primary) !important;
}

.bg-valley-secondary {
    background-color: var(--valley-secondary) !important;
}

.text-valley-primary {
    color: var(--valley-primary) !important;
}

.text-valley-secondary {
    color: var(--valley-secondary) !important;
}

.text-valley-light {
    color: var(--valley-light) !important;
}

.btn-valley-primary {
    background-color: var(--valley-primary);
    border-color: var(--valley-primary);
    color: white;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-valley-primary:hover,
.btn-valley-primary:focus {
    background-color: #5a359a;
    border-color: #5a359a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

.btn-valley-secondary {
    background-color: var(--valley-secondary);
    border-color: var(--valley-secondary);
    color: white;
    font-weight: 500;
}

.btn-valley-secondary:hover {
    background-color: #1ba87c;
    border-color: #1ba87c;
    color: white;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.valley-logo {
    color: var(--valley-primary);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--valley-dark) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--valley-primary) !important;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--valley-primary) 0%, #8b5cf6 100%);
    border-radius: 0;
}

.hero-banner h2 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Hero Steps Toggle (mobile) */
.hero-steps-toggle {
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
}

.hero-steps-toggle i {
    transition: transform 0.2s ease;
}

.hero-steps-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Hero Steps Process */
.hero-steps {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-steps .step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    min-width: 120px;
    max-width: 140px;
    position: relative;
}

.hero-steps .step-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.hero-steps .step-number {
    background: white;
    color: var(--valley-primary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hero-steps .step-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.hero-steps .step-desc {
    font-size: 0.8rem;
    opacity: 0.9;
}

.hero-steps .step-arrow {
    display: flex;
    align-items: center;
    padding-top: 2rem;
    font-size: 1.25rem;
    opacity: 0.7;
}

/* Compact hero steps for mid-width screens before mobile layout kicks in */
@media (min-width: 768px) and (max-width: 1100px) {
    .hero-steps {
        gap: 0;
    }

    .hero-steps .step-item {
        min-width: 80px;
        max-width: 110px;
        padding: 0.5rem 0.25rem;
    }

    .hero-steps .step-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .hero-steps .step-title {
        font-size: 0.8rem;
    }

    .hero-steps .step-desc {
        font-size: 0.7rem;
    }

    .hero-steps .step-arrow {
        font-size: 1rem;
        padding-top: 1.5rem;
    }
}

/* Mobile responsive for hero steps */
@media (max-width: 767.98px) {
    .hero-steps {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
    
    .hero-steps .step-item {
        flex-direction: row;
        max-width: 320px;
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        align-items: center;
    }

    .hero-steps .step-icon {
        width: 46px;
        height: 46px;
        font-size: 1.15rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .hero-steps .step-number {
        position: static;
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .hero-steps .step-text {
        display: flex;
        flex-direction: column;
        text-align: left;
        flex: 1;
    }

    .hero-steps .step-title {
        margin-bottom: 0.1rem;
    }
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

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

.test-card {
    height: 100%;
}

.test-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.test-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--valley-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.test-card .card-text {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.test-card .mt-auto {
    margin-top: auto !important;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--valley-primary);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.15);
}

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

/* Checkout Steps */
.checkout-steps {
    margin-bottom: 2rem;
}

.checkout-steps .d-flex {
    align-items: center;
    justify-content: center;
}

.step-item {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background-color: #e9ecef;
    color: #6c757d;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.step-item.active .step-number {
    background-color: var(--valley-primary);
    color: white;
}

.step-item.completed .step-number {
    background-color: var(--valley-success);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--valley-gray);
}

.step-item.active .step-label {
    color: var(--valley-primary);
}

.step-line {
    width: 100px;
    height: 2px;
    background-color: #e9ecef;
    margin: 0 1rem;
}

/* ── Order Progress Tracker ─────────────────────────────────────────── */
.order-progress {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.order-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 1rem;
    min-width: 110px;
    max-width: 145px;
}

.order-progress-step .ops-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

/* Pending — greyed out */
.order-progress-step.pending .ops-icon {
    background: #e9ecef;
    color: #adb5bd;
}

/* Active — primary colour with subtle ring */
.order-progress-step.active .ops-icon {
    background: var(--valley-primary);
    color: white;
    box-shadow: 0 0 0 5px rgba(111, 66, 193, 0.15);
}

/* Complete — success green */
.order-progress-step.complete .ops-icon {
    background: #198754;
    color: white;
}

.ops-number {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #adb5bd;
}

.order-progress-step.active .ops-number {
    color: var(--valley-primary);
}

.order-progress-step.complete .ops-number {
    color: #198754;
}

.ops-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
    color: #adb5bd;
}

.order-progress-step.active .ops-title {
    color: var(--valley-primary);
}

.order-progress-step.complete .ops-title {
    color: #198754;
}

.ops-desc {
    font-size: 0.77rem;
    color: #adb5bd;
    line-height: 1.3;
}

.order-progress-step.active .ops-desc,
.order-progress-step.complete .ops-desc {
    color: #6c757d;
}

.ops-arrow {
    display: flex;
    align-items: flex-start;
    padding-top: 1.75rem;
    font-size: 1rem;
    color: #dee2e6;
}

/* Mobile: stack steps vertically, icon + text in a row */
@media (max-width: 767.98px) {
    .order-progress {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .order-progress-step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        max-width: 100%;
        gap: 1rem;
        padding: 0.6rem 0.5rem;
    }

    .order-progress-step .ops-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .ops-arrow {
        display: none !important;
    }
}

/* Progress Elements */
.progress-line {
    height: 3px;
    background: linear-gradient(to right, var(--valley-secondary) 0%, var(--valley-light) 100%);
    border-radius: 2px;
}

.progress-arrow i {
    color: var(--valley-secondary);
}

/* Payment Methods */
.payment-details {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    background-color: #fafbfc;
}

/* Order Summary */
.card-header {
    background-color: var(--valley-background);
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Activity Feed */
.activity-feed .activity-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.activity-feed .activity-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.activity-feed .activity-item i {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 16px;
    text-align: center;
}

.activity-feed .activity-item span {
    flex: 1;
}

/* Test Image Placeholder */
.test-image-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px dashed #ced4da;
}

/* Modals */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: var(--valley-background);
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    font-weight: 600;
    color: var(--valley-dark);
}

/* Sticky Elements */
.sticky-top {
    position: sticky;
    top: 20px;
    z-index: 990;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--valley-dark);
    background-color: var(--valley-background);
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(111, 66, 193, 0.05);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 4px solid var(--valley-info);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid var(--valley-success);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--valley-warning);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid var(--valley-danger);
}

/* Footer */
footer {
    background-color: white !important;
    border-top: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--valley-primary) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-banner {
        padding: 2rem 0;
    }
    
    .hero-banner h2 {
        font-size: 1.75rem;
    }
    
    .checkout-steps .step-line {
        width: 50px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .btn-valley-primary {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .test-card .card-body {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--valley-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a359a;
}

/* Focus Styles for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--valley-primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-valley-primary {
        border: 2px solid #000;
    }
    
    .text-muted {
        color: #000 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
