/**
 * Frontend CSS for Pathology Lab Booking Plugin
 * Modern, responsive design with clean UI
 */

/* Base Styles */
.plb-booking-form-container,
.plb-customer-dashboard-container,
.plb-collector-dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Cards */
.plb-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.plb-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Form Styles */
.plb-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plb-form-row {
    display: flex;
    gap: 16px;
}

.plb-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plb-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.plb-form-group input,
.plb-form-group textarea,
.plb-form-group select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background-color: #ffffff;
}

.plb-form-group input:focus,
.plb-form-group textarea:focus,
.plb-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.plb-form-group small {
    color: #6b7280;
    font-size: 12px;
}

/* Step Indicator */
.plb-steps-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

.plb-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    max-width: 120px;
}

.plb-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.plb-step.active:not(:last-child)::after,
.plb-step.completed:not(:last-child)::after {
    background: #3b82f6;
}

.plb-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    z-index: 2;
    position: relative;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.plb-step.active .plb-step-number {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.plb-step.completed .plb-step-number {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.plb-step-title {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.plb-step.active .plb-step-title,
.plb-step.completed .plb-step-title {
    color: #374151;
}

/* Form Steps */
.plb-form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.plb-form-step.active {
    display: block;
}

.plb-form-step h3 {
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

/* Test Selection */
.plb-test-category {
    margin-bottom: 32px;
}

.plb-test-category h4 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.plb-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.plb-test-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.plb-test-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.plb-test-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.plb-test-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.plb-test-header input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #3b82f6;
}

.plb-test-header label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    gap: 8px;
}

.plb-test-name {
    font-weight: 600;
    color: #111827;
    font-size: 14px;
}

.plb-test-price {
    font-weight: 700;
    color: #059669;
    font-size: 14px;
    white-space: nowrap;
}

.plb-test-code {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.plb-test-description {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

/* Selected Tests Summary */
.plb-selected-tests-summary {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.plb-selected-tests-summary h4 {
    color: #0c4a6e;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.plb-total-amount {
    text-align: right;
    padding-top: 12px;
    border-top: 1px solid #bae6fd;
    font-size: 18px;
    color: #0c4a6e;
}

/* Time Slots */
.plb-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.plb-time-slot {
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.plb-time-slot:hover:not(.unavailable) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.plb-time-slot.selected {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
}

.plb-time-slot.unavailable {
    background: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Payment Methods */
.plb-payment-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.plb-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.plb-summary-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
}

.plb-amount {
    font-weight: 600;
    color: #059669;
}

.plb-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plb-payment-option {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plb-payment-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.plb-payment-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.plb-payment-option input[type="radio"] {
    display: none;
}

.plb-payment-option label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.plb-payment-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.plb-payment-details {
    flex: 1;
}

.plb-payment-title {
    font-weight: 600;
    color: #111827;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.plb-payment-desc {
    color: #6b7280;
    font-size: 14px;
}

/* Buttons */
.plb-btn {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.plb-btn-primary {
    background: #3b82f6;
    color: white;
}

.plb-btn-primary:hover {
    background: #2563eb;
}

.plb-btn-secondary {
    background: #6b7280;
    color: white;
}

.plb-btn-secondary:hover {
    background: #4b5563;
}

.plb-btn-success {
    background: #10b981;
    color: white;
}

.plb-btn-success:hover {
    background: #059669;
}

/* Form Navigation */
.plb-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Login Container */
.plb-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.plb-login-container .plb-card {
    max-width: 400px;
    width: 100%;
}

.plb-login-container h3 {
    text-align: center;
    margin-bottom: 24px;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.plb-login-help {
    margin-top: 16px;
    text-align: center;
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
}

/* Messages */
.plb-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
    display: block;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.plb-success {
    color: #059669;
    font-size: 13px;
    margin-top: 4px;
    padding: 12px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
}

.plb-dashboard-container .plb-success-message {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Loading States */
.plb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.plb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

/* Success Message */
.plb-success-message {
    text-align: center;
    padding: 40px;
}

.plb-success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.plb-success-message h3 {
    color: #059669;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Dashboard Styles */
.plb-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.plb-dashboard-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.plb-dashboard-header .plb-btn {
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.plb-dashboard-header .plb-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.plb-dashboard-actions {
    display: flex;
    gap: 12px;
}

.plb-dashboard-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.plb-tab-btn {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: white;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.plb-tab-btn:not(:last-child) {
    border-right: 1px solid #e5e7eb;
}

.plb-tab-btn:hover {
    background: #f8fafc;
    color: #374151;
}

.plb-tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plb-tab-btn.active:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.plb-tab-content {
    display: none;
}

.plb-tab-content.active {
    display: block;
}

/* Collector Dashboard */
.plb-collector-info h2 {
    margin: 0 0 4px 0;
    color: #111827;
}

.plb-collector-designation {
    color: #6b7280;
    font-size: 14px;
}

.plb-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.plb-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.plb-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
}

.plb-stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Status Badges */
.plb-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.plb-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.plb-status-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.plb-status-collected {
    background: #e0e7ff;
    color: #5b21b6;
}

.plb-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.plb-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Modal */
.plb-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.plb-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.plb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.plb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.plb-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
}

.plb-modal-close:hover {
    color: #111827;
}

.plb-modal-body {
    padding: 24px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .plb-booking-form-container,
    .plb-customer-dashboard-container,
    .plb-collector-dashboard-container {
        padding: 16px;
    }

    .plb-form-row {
        flex-direction: column;
        gap: 16px;
    }

    .plb-test-grid {
        grid-template-columns: 1fr;
    }

    .plb-time-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .plb-steps-indicator {
        padding: 0 10px;
    }

    .plb-step-title {
        font-size: 10px;
    }

    .plb-dashboard-header {
        flex-direction: column;
        gap: 16px;
    }

    .plb-dashboard-actions {
        align-self: stretch;
    }

    .plb-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .plb-modal-content {
        width: 95%;
        margin: 20px;
    }
}
/* Fix for removing red underlines from form validation */
.plb-form-group input.error,
.plb-form-group textarea.error,
.plb-form-group select.error {
    text-decoration: none !important;
    box-shadow: none !important;
}

.plb-form-group input:focus.error,
.plb-form-group textarea:focus.error,  
.plb-form-group select:focus.error {
    text-decoration: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Remove browser default invalid styling that causes red underlines */
.plb-form-group input:invalid,
.plb-form-group textarea:invalid,
.plb-form-group select:invalid {
    box-shadow: none;
    text-decoration: none;
    border: 1px solid #d1d5db;
}

.plb-form-group input:focus:invalid,
.plb-form-group textarea:focus:invalid,
.plb-form-group select:focus:invalid {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

/* Advance payment highlighting styles */
.plb-advance-highlight {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border: 2px solid #3b82f6 !important;
    font-weight: 600 !important;
    color: #1e40af !important;
    animation: pulseHighlight 1.5s ease-in-out infinite alternate;
}

.plb-balance-highlight {
    background: #f0f9ff !important;
    border: 1px solid #93c5fd !important;
    color: #1e40af !important;
}

.plb-advance-notice {
    margin-top: 16px;
    padding: 0;
}

.plb-highlight-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.2);
    animation: gentlePulse 2s ease-in-out infinite alternate;
}

.plb-highlight-box h4 {
    margin: 0 0 12px 0;
    color: #92400e;
    font-size: 18px;
    font-weight: 700;
}

.plb-highlight-box p {
    margin: 8px 0;
    color: #78350f;
}

.plb-highlight-box strong {
    color: #92400e;
    font-size: 16px;
}

/* Animations */
@keyframes pulseHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 8px -2px rgba(59, 130, 246, 0.3);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
    }
}

@keyframes gentlePulse {
    0% {
        transform: translateY(0px);
        box-shadow: 0 8px 16px -4px rgba(245, 158, 11, 0.2);
    }
    100% {
        transform: translateY(-2px);
        box-shadow: 0 12px 20px -4px rgba(245, 158, 11, 0.3);
    }
}

