/**
 * ENNU Face Chart - Patient History Mode Styles
 *
 * Luxury design system integration with ENNU aesthetic branding.
 * Responsive layout optimized for iPad and desktop.
 *
 * @package ENNU_Face_Charting
 * @since 6.0.0
 */

/* ==========================================================================
   CSS Variables - Luxury Design System
   ========================================================================== */
.patient-history-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ==========================================================================
   Panel Header
   ========================================================================== */
.patient-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #C9A962 0%, #B8954D 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ph-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ph-header-left .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ph-header-left h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ph-header-right {
    display: flex;
    gap: 8px;
}

.ph-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ph-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ph-header-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ph-loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: #6c757d;
    font-size: 16px;
}

/* ==========================================================================
   CSS Variables Continued
   ========================================================================== */
:root {
    --ph-gold: #C9A962;
    --ph-gold-dark: #B8954D;
    --ph-gold-light: #D4BC7D;
    --ph-charcoal: #2c3e50;
    --ph-charcoal-light: #34495e;
    --ph-white: #ffffff;
    --ph-off-white: #f8f9fa;
    --ph-gray-100: #f5f5f5;
    --ph-gray-200: #e9ecef;
    --ph-gray-300: #dee2e6;
    --ph-gray-400: #ced4da;
    --ph-gray-500: #adb5bd;
    --ph-gray-600: #6c757d;
    --ph-gray-700: #495057;
    --ph-green: #28a745;
    --ph-green-light: #d4edda;
    --ph-orange: #fd7e14;
    --ph-orange-light: #fff3cd;
    --ph-red: #dc3545;
    --ph-red-light: #f8d7da;
    --ph-blue: #007bff;
    --ph-blue-light: #cce5ff;
    --ph-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --ph-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --ph-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --ph-radius-sm: 6px;
    --ph-radius-md: 10px;
    --ph-radius-lg: 16px;
    --ph-transition: all 0.25s ease;
}

/* ==========================================================================
   Panel Container
   ========================================================================== */
/* Patient History Panel - Mode Panel (same pattern as treatment-billing, tip, notes, refer) */
#patient-history-panel,
.patient-history-panel {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: var(--space-6, 24px);
    background: var(--ph-off-white, #FAF9F6);
    overflow-y: auto;
    overflow-x: hidden;
}

#patient-history-panel.active,
.patient-history-panel.active {
    display: flex;
}

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

#patient-history-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Section Base Styles
   ========================================================================== */
.ph-section {
    background: var(--ph-white);
    border-radius: var(--ph-radius-md);
    margin-bottom: 16px;
    box-shadow: var(--ph-shadow-sm);
    transition: var(--ph-transition);
}

.ph-section:hover {
    box-shadow: var(--ph-shadow-md);
}

.ph-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: var(--ph-transition);
}

.ph-section-header:hover {
    background: var(--ph-gray-100);
}

.ph-section-header:focus {
    outline: 2px solid var(--ph-gold);
    outline-offset: -2px;
}

.ph-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ph-charcoal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ph-section-header h3 i {
    color: var(--ph-gold);
    width: 20px;
    text-align: center;
}

.ph-chart-summary {
    font-size: 13px;
    font-weight: 400;
    color: var(--ph-gray-600);
    margin-left: 12px;
}

.ph-toggle-icon {
    color: var(--ph-gray-500);
    transition: transform 0.25s ease;
}

.ph-section-content {
    padding: 16px 20px;
    border-top: 1px solid var(--ph-gray-200);
}

/* Collapsible Sections */
.ph-collapsible .ph-section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.ph-collapsible.ph-collapsed .ph-section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

.ph-collapsible.ph-collapsed .ph-toggle-icon {
    transform: rotate(-90deg);
}

/* ==========================================================================
   Patient Identity Card
   ========================================================================== */
.ph-basic-info {
    background: linear-gradient(135deg, var(--ph-gold) 0%, var(--ph-gold-dark) 100%);
    color: var(--ph-white);
    padding: 24px;
    box-shadow: var(--ph-shadow-lg);
}

.ph-patient-card {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ph-avatar {
    flex-shrink: 0;
}

.ph-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ph-patient-details {
    flex: 1;
    min-width: 0;
}

.ph-patient-name {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.ph-legal-name {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.85;
}

.ph-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ph-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    opacity: 0.9;
}

.ph-meta-item i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

/* ==========================================================================
   Safety Alerts
   ========================================================================== */
.ph-safety-alerts {
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ph-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--ph-radius-sm);
    font-size: 14px;
    line-height: 1.5;
}

.ph-alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.ph-alert strong {
    margin-right: 4px;
}

.ph-alert-red {
    background: var(--ph-red-light);
    color: var(--ph-red);
    border-left: 4px solid var(--ph-red);
}

.ph-alert-orange {
    background: var(--ph-orange-light);
    color: #856404;
    border-left: 4px solid var(--ph-orange);
}

.ph-alert-yellow {
    background: #fffacd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.ph-alert-blue {
    background: var(--ph-blue-light);
    color: #004085;
    border-left: 4px solid var(--ph-blue);
}

.ph-has-critical .ph-alert-red {
    animation: phPulse 2s infinite;
}

@keyframes phPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ==========================================================================
   Status Bar (ID Verification & Consents)
   ========================================================================== */
.ph-status-bar {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.ph-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--ph-radius-sm);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    min-width: 200px;
}

.ph-status-item > i {
    font-size: 20px;
    flex-shrink: 0;
}

.ph-status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ph-status-label {
    font-weight: 600;
}

.ph-status-date {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

.ph-status-note {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    font-style: italic;
}

.ph-status-item small {
    opacity: 0.7;
    font-weight: 400;
    margin-left: 4px;
}

.ph-status-item.ph-status-unavailable {
    opacity: 0.8;
}

.ph-status-green {
    background: var(--ph-green-light);
    color: #155724;
}

.ph-status-green i {
    color: var(--ph-green);
}

.ph-status-orange {
    background: var(--ph-orange-light);
    color: #856404;
}

.ph-status-orange i {
    color: var(--ph-orange);
}

.ph-status-red {
    background: var(--ph-red-light);
    color: #721c24;
}

.ph-status-red i {
    color: var(--ph-red);
}

.ph-status-gray {
    background: var(--ph-gray-200);
    color: var(--ph-gray-600);
}

.ph-status-gray i {
    color: var(--ph-gray-500);
}

/* ==========================================================================
   Aesthetic Profile
   ========================================================================== */
.ph-aesthetic-profile .ph-section-header h3 i {
    color: var(--ph-gold);
}

.ph-profile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ph-gray-200);
}

.ph-profile-row:last-child {
    border-bottom: none;
}

.ph-profile-row strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ph-charcoal);
    min-width: 140px;
}

.ph-profile-row strong i {
    color: var(--ph-gold);
    width: 16px;
    text-align: center;
}

.ph-profile-row span {
    color: var(--ph-gray-700);
    flex: 1;
}

/* ==========================================================================
   Chart History
   ========================================================================== */
.ph-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ph-chart-card {
    display: flex;
    background: var(--ph-gray-100);
    border-radius: var(--ph-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--ph-transition);
    border: 1px solid var(--ph-gray-200);
}

.ph-chart-card:hover {
    background: var(--ph-white);
    border-color: var(--ph-gold);
    box-shadow: var(--ph-shadow-md);
    transform: translateY(-2px);
}

.ph-chart-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: var(--ph-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ph-chart-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-chart-placeholder {
    color: var(--ph-gray-400);
    font-size: 24px;
}

.ph-chart-info {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ph-chart-date {
    font-size: 12px;
    color: var(--ph-gold-dark);
    font-weight: 600;
}

.ph-chart-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--ph-charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0;
}

.ph-chart-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--ph-gray-600);
}

.ph-chart-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ph-chart-meta i {
    font-size: 11px;
    color: var(--ph-gold);
}

.ph-chart-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.ph-chart-status-completed {
    color: var(--ph-green);
}

.ph-chart-status-draft {
    color: var(--ph-orange);
}

.ph-chart-status-reviewed {
    color: var(--ph-blue);
}

.ph-chart-status-archived {
    color: var(--ph-gray-500);
}

/* ==========================================================================
   Warnings Section
   ========================================================================== */
.ph-warnings {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 14px 18px;
}

.ph-warnings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 8px;
}

.ph-warnings ul {
    margin: 0;
    padding-left: 28px;
    font-size: 12px;
    color: #856404;
}

.ph-warnings li {
    margin-bottom: 4px;
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */
.ph-skeleton-container {
    padding: 8px 0;
}

.ph-skeleton {
    background: linear-gradient(90deg, 
        var(--ph-gray-200) 25%, 
        var(--ph-gray-100) 50%, 
        var(--ph-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: phShimmer 1.5s infinite;
    border-radius: var(--ph-radius-sm);
}

@keyframes phShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ph-skeleton-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--ph-gold);
    border-radius: var(--ph-radius-md);
    margin-bottom: 16px;
}

.ph-skeleton-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.ph-skeleton-text {
    flex: 1;
}

.ph-skeleton-title {
    height: 28px;
    width: 60%;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.3);
}

.ph-skeleton-subtitle {
    height: 18px;
    width: 40%;
    background: rgba(255, 255, 255, 0.3);
}

.ph-skeleton-alert {
    height: 50px;
    margin-bottom: 16px;
}

.ph-skeleton-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ph-skeleton-badge {
    height: 50px;
    flex: 1;
}

.ph-skeleton-section {
    height: 120px;
    margin-bottom: 16px;
}

/* ==========================================================================
   Error State
   ========================================================================== */
.ph-error-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--ph-gray-600);
}

.ph-error-state i {
    font-size: 64px;
    color: var(--ph-red);
    margin-bottom: 20px;
    display: block;
}

.ph-error-state h3 {
    font-size: 20px;
    color: var(--ph-charcoal);
    margin: 0 0 10px 0;
}

.ph-error-state p {
    margin: 0 0 24px 0;
}

.ph-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ph-gold) 0%, var(--ph-gold-dark) 100%);
    color: var(--ph-white);
    border: none;
    border-radius: var(--ph-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ph-transition);
}

.ph-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--ph-shadow-md);
}

/* Empty Message */
.ph-empty-message {
    text-align: center;
    color: var(--ph-gray-500);
    font-style: italic;
    padding: 20px;
}

/* ==========================================================================
   Empty State Notices
   ========================================================================== */
.ph-empty-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--ph-radius-sm);
    font-size: 14px;
    line-height: 1.5;
}

.ph-empty-notice i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Notice Variants */
.ph-notice-info {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.08) 0%, rgba(99, 179, 237, 0.08) 100%);
    border: 1px solid rgba(66, 153, 225, 0.2);
    color: #2b6cb0;
}

.ph-notice-info i {
    color: #3182ce;
}

.ph-notice-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.08) 0%, rgba(104, 211, 145, 0.08) 100%);
    border: 1px solid rgba(72, 187, 120, 0.2);
    color: #276749;
}

.ph-notice-success i {
    color: #38a169;
}

.ph-notice-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.08) 0%, rgba(246, 173, 85, 0.08) 100%);
    border: 1px solid rgba(237, 137, 54, 0.2);
    color: #c05621;
}

.ph-notice-warning i {
    color: #dd6b20;
}

.ph-notice-error {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.08) 0%, rgba(252, 129, 129, 0.08) 100%);
    border: 1px solid rgba(245, 101, 101, 0.2);
    color: #c53030;
}

.ph-notice-error i {
    color: #e53e3e;
}

.ph-notice-muted {
    background: var(--ph-gray-100);
    border: 1px solid var(--ph-gray-200);
    color: var(--ph-gray-600);
}

.ph-notice-muted i {
    color: var(--ph-gray-400);
}

/* Field Checklist (for showing what's missing) */
.ph-field-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--ph-gray-200);
}

.ph-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 8px 12px;
    background: var(--ph-white);
    border-radius: var(--ph-radius-sm);
    border: 1px solid var(--ph-gray-200);
}

.ph-checklist-item.ph-complete {
    color: var(--ph-green);
    border-color: rgba(72, 187, 120, 0.3);
    background: rgba(72, 187, 120, 0.05);
}

.ph-checklist-item.ph-complete i {
    color: var(--ph-green);
}

.ph-checklist-item.ph-missing {
    color: var(--ph-gray-500);
    border-color: var(--ph-gray-200);
}

.ph-checklist-item.ph-missing i {
    color: var(--ph-gray-400);
}

/* Profile Row Empty State */
.ph-profile-row.ph-field-empty {
    opacity: 0.7;
}

.ph-not-provided {
    font-style: italic;
    color: var(--ph-gray-500);
}

/* Missing Fields Notice */
.ph-missing-fields-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(237, 137, 54, 0.08);
    border: 1px solid rgba(237, 137, 54, 0.2);
    border-radius: var(--ph-radius-sm);
    font-size: 12px;
    color: #c05621;
}

.ph-missing-fields-notice i {
    color: #dd6b20;
}

/* Meta Item Missing State */
.ph-meta-item.ph-meta-missing {
    color: var(--ph-gray-500);
}

.ph-meta-item.ph-meta-missing em {
    font-style: italic;
}

.ph-meta-item.ph-meta-secondary {
    color: var(--ph-gray-500);
    font-size: 13px;
}

/* Safety Alerts Section - No Alerts State */
.ph-safety-alerts.ph-no-alerts .ph-section-header h3 {
    color: var(--ph-gray-500);
}

/* Unavailable Section */
.ph-section.ph-unavailable {
    background: var(--ph-gray-100);
    border-color: var(--ph-gray-200);
}

/* ==========================================================================
   Responsive - iPad Optimization
   ========================================================================== */
@media (max-width: 1024px) {
    #patient-history-content {
        padding: 16px;
    }

    .ph-patient-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .ph-patient-name {
        font-size: 24px;
    }

    .ph-patient-meta {
        justify-content: center;
    }

    .ph-status-bar {
        flex-direction: column;
    }

    .ph-status-item {
        min-width: auto;
    }

    .ph-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .ph-avatar img {
        width: 80px;
        height: 80px;
    }

    .ph-patient-name {
        font-size: 20px;
    }

    .ph-legal-name {
        display: block;
        margin-top: 4px;
    }

    .ph-meta-item {
        font-size: 13px;
    }

    .ph-chart-card {
        flex-direction: column;
    }

    .ph-chart-thumbnail {
        width: 100%;
        height: 120px;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .ph-dark-mode-enabled #patient-history-panel {
        background: #1a1a2e;
    }

    .ph-dark-mode-enabled .ph-section {
        background: #16213e;
        border-color: #0f3460;
    }

    .ph-dark-mode-enabled .ph-section-header h3,
    .ph-dark-mode-enabled .ph-chart-title {
        color: #e8e8e8;
    }
}

/* ==========================================================================
   Pending Documents with Reminders
   ========================================================================== */

.ph-pending-docs-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ph-gray-200);
}

.ph-pending-docs-header {
    font-size: 12px;
    color: var(--ph-gray-600);
    margin-bottom: 8px;
}

.ph-pending-docs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ph-pending-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--ph-white);
    border: 1px solid var(--ph-gray-200);
    border-radius: var(--ph-radius-sm);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ph-pending-doc-item:hover {
    background: var(--ph-gray-50);
    border-color: var(--ph-gray-300);
}

.ph-doc-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ph-doc-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ph-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-sign-link {
    color: var(--ph-blue);
    font-size: 11px;
    flex-shrink: 0;
    text-decoration: none;
}

.ph-sign-link:hover {
    color: var(--ph-blue);
    text-decoration: underline;
}

.ph-doc-actions {
    flex-shrink: 0;
    margin-left: 8px;
}

.ph-reminder-dropdown {
    position: relative;
}

.ph-btn-reminder {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ph-gray-700);
    background: linear-gradient(135deg, var(--ph-gray-100) 0%, var(--ph-gray-50) 100%);
    border: 1px solid var(--ph-gray-300);
    border-radius: var(--ph-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ph-btn-reminder:hover {
    background: linear-gradient(135deg, var(--ph-gray-200) 0%, var(--ph-gray-100) 100%);
    border-color: var(--ph-gray-400);
}

.ph-btn-reminder:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ph-btn-reminder i {
    font-size: 10px;
}

.ph-reminder-options {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--ph-white);
    border: 1px solid var(--ph-gray-200);
    border-radius: var(--ph-radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 110px;
    overflow: hidden;
}

.ph-reminder-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ph-reminder-option:hover {
    background: var(--ph-gray-100);
}

.ph-reminder-option + .ph-reminder-option {
    border-top: 1px solid var(--ph-gray-100);
}

/* ==========================================================================
   Document Lists Container (Signed, Expired, Pending)
   ========================================================================== */
.ph-documents-container {
    margin-top: 12px;
}

.ph-docs-list {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--ph-radius-sm);
    background: var(--ph-gray-50);
}

.ph-docs-list:last-child {
    margin-bottom: 0;
}

.ph-docs-header {
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ph-docs-header i {
    font-size: 11px;
}

.ph-docs-header-expired {
    color: #dc3545;
}

.ph-docs-header-pending {
    color: #d97706;
}

.ph-docs-header-signed {
    color: #10b981;
}

.ph-docs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ph-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--ph-white);
    border: 1px solid var(--ph-gray-200);
    border-radius: var(--ph-radius-sm);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ph-doc-item:last-child {
    margin-bottom: 0;
}

.ph-doc-item:hover {
    background: var(--ph-gray-50);
    border-color: var(--ph-gray-300);
}

/* Expired document item styling */
.ph-doc-expired {
    background: #fef2f2;
    border-color: #fecaca;
}

.ph-doc-expired:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.ph-doc-expired .ph-doc-name {
    color: #991b1b;
}

.ph-doc-expired-date {
    font-size: 11px;
    color: #dc3545;
    font-weight: 500;
}

/* Pending document item styling */
.ph-doc-pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.ph-doc-pending:hover {
    background: #fef3c7;
    border-color: #fcd34d;
}

/* Signed document item styling */
.ph-doc-signed {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.ph-doc-signed:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.ph-doc-signed .ph-doc-name {
    color: #065f46;
}

.ph-doc-check {
    color: #10b981;
    font-size: 12px;
}

.ph-doc-dates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 12px;
}

.ph-doc-date {
    font-size: 11px;
    color: var(--ph-gray-500);
    white-space: nowrap;
}

.ph-doc-expires {
    color: #d97706;
}

/* Urgent reminder button for expired docs */
.ph-btn-reminder-urgent {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
    color: #991b1b;
}

.ph-btn-reminder-urgent:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    border-color: #f87171;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    #patient-history-panel {
        position: static;
        overflow: visible;
    }

    .ph-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .ph-collapsible .ph-section-content {
        max-height: none !important;
    }

    .ph-toggle-icon,
    .ph-retry-btn,
    .ph-reminder-dropdown {
        display: none;
    }
}

