/* POH - Prescription for Optimal Health Styles */

:root {
    --poh-primary: #0d6efd;
    --poh-secondary: #6c757d;
    --poh-success: #198754;
    --poh-warning: #ffc107;
    --poh-danger: #dc3545;
}

/* Layout */
body {
    background-color: #f8f9fa;
}

#app-content {
    max-width: 1600px;
    margin: 0 auto;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Tables */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    cursor: pointer;
}

/* Prescription Editor Table */
.prescription-table {
    font-size: 0.875rem;
}

.prescription-table th {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 0.25rem;
}

.prescription-table td {
    padding: 0.25rem;
    vertical-align: middle;
}

.prescription-table input[type="text"] {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    min-width: 60px;
}

.prescription-table .form-select {
    font-size: 0.8rem;
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
}

.prescription-table .supplement-cell {
    min-width: 200px;
}

.prescription-table .supplement-cell input {
    min-width: 180px;
}

.prescription-table .timing-cell {
    width: 70px;
}

.prescription-table .timing-cell input {
    width: 100%;
    text-align: center;
}

.prescription-table .change-flag-cell {
    width: 80px;
}

.prescription-table .actions-cell {
    width: 100px;
    white-space: nowrap;
}

/* Change flag colors */
.change-flag-new {
    background-color: #d1e7dd !important;
}

.change-flag-stop {
    background-color: #f8d7da !important;
}

.change-flag-change {
    background-color: #fff3cd !important;
}

.change-flag-rx {
    background-color: #cfe2ff !important;
}

.change-flag-otc {
    background-color: #e2e3e5 !important;
}

/* Autocomplete styles */
.autoComplete_wrapper {
    display: block;
    width: 100%;
}

.autoComplete_wrapper > input {
    width: 100%;
}

.autoComplete_result {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.autoComplete_result:hover,
.autoComplete_result[aria-selected="true"] {
    background-color: var(--poh-primary);
    color: white;
}

.autoComplete_list {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Instructions section */
.instructions-section {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
}

.instruction-snippet {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.instruction-snippet:last-child {
    margin-bottom: 0;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        font-size: 10pt;
    }

    .container-fluid {
        padding: 0;
    }

    .card {
        border: none;
        box-shadow: none;
    }
}

/* Print preview container */
.print-preview {
    background: white;
    padding: 20px;
    max-width: 8.5in;
    margin: 0 auto;
}

.print-preview .header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
}

.print-preview .header-left {
    font-size: 0.9rem;
}

.print-preview .header-center {
    text-align: center;
}

.print-preview .header-center h1 {
    font-size: 1.25rem;
    margin: 0;
}

.print-preview .header-right {
    text-align: right;
    font-size: 0.9rem;
}

.print-preview .patient-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.print-preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.print-preview th,
.print-preview td {
    border: 1px solid #000;
    padding: 2px 4px;
    text-align: center;
}

.print-preview th {
    background-color: #f0f0f0;
    font-size: 0.7rem;
}

.print-preview .supplement-col {
    text-align: left;
    min-width: 200px;
}

.print-preview .supplement-name {
    font-weight: bold;
}

.print-preview .supplement-desc {
    font-size: 0.7rem;
    color: #666;
}

.print-preview .instructions-section {
    margin-top: 1rem;
    font-size: 0.85rem;
}

.print-preview .footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    font-style: italic;
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bootstrap table customizations */
.bootstrap-table .fixed-table-container {
    border: none;
}

.bootstrap-table .fixed-table-toolbar .search input {
    height: 38px;
}

/* Button group in tables */
.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
}

/* Form validation */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--poh-danger);
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--poh-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}
