/*
 * Enbarezept Yönetimi - Frontend Stilleri
 * v2.3.0 - Added patient status tags and action date styles.
 */

/* --- WooCommerce "Hesabım" Sayfası Uyumluluk Düzeltmesi --- */
.woocommerce-account .woocommerce-MyAccount-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- Genel Panel ve Tipografi Ayarları --- */
.doctor-dashboard-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: transparent;
    padding: 0;
    position: relative;
    width: 100%;
}

/* --- İstatistik Kutuları --- */
.enba-stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.enba-stat-box { background-color: #fff; padding: 20px; border-radius: 12px; border: 1px solid #e5e7eb; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.enba-stat-box .stat-value { display: block; font-size: 28px; font-weight: 700; color: #111827; }
.enba-stat-box .stat-label { display: block; font-size: 14px; color: #6b7280; margin-top: 5px; }

/* --- Arama ve Araç Çubuğu --- */
.enba-panel-toolbar { margin-bottom: 20px; }
.enba-search-form { position: relative; max-width: 400px; }
.enba-search-field { width: 100%; padding: 12px 40px 12px 15px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; }
.enba-search-field:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); outline: none; }
.enba-search-submit { position: absolute; top: 0; right: 0; height: 100%; width: 45px; background: transparent; border: none; cursor: pointer; color: #6b7280; }
.enba-search-submit .dashicons { font-size: 20px; }

/* --- Sekme Navigasyonu --- */
.doctor-dashboard-wrapper .enbarezept-tabs { display: flex; gap: 10px; border-bottom: 2px solid #e5e7eb; margin-bottom: 30px; }
.doctor-dashboard-wrapper .enbarezept-tabs a { padding: 12px 22px; text-decoration: none; color: #4b5563; font-weight: 600; border-bottom: 3px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; font-size: 15px; }
.doctor-dashboard-wrapper .enbarezept-tabs a.active, .doctor-dashboard-wrapper .enbarezept-tabs a:hover { color: #2563eb; border-bottom-color: #2563eb; }

/* --- Kart Izgara (Grid) Tasarımı --- */
.enba-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 25px; }
.enba-no-results { color: #6b7280; font-size: 16px; padding: 40px; background-color: #fff; border-radius: 12px; text-align: center; border: 1px solid #e5e7eb; }
.enba-card { display: flex; flex-direction: column; background-color: #ffffff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #e5e7eb; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.enba-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0,0,0,0.08); }

/* GÜNCELLENDİ: Kart Başlığı */
.enba-card-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 25px; border-bottom: 1px solid #f3f4f6; }
.enba-card-title-wrapper { display: flex; flex-direction: column; gap: 8px; }
.enba-card-title { font-size: 18px; font-weight: 700; color: #111827; }

/* YENİ: Hasta Durum Etiketi (Yeni/Dönen) */
.enba-patient-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
    align-self: flex-start;
}
.enba-patient-tag.new { background-color: #d1fae5; color: #065f46; }
.enba-patient-tag.returning { background-color: #e0e7ff; color: #3730a3; }

/* GÜNCELLENDİ: Kart Gövdesi */
.enba-card-body { padding: 20px 25px; flex-grow: 1; display: flex; flex-direction: column; gap: 16px; }
.enba-card-detail { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.enba-card-detail-label { color: #6b7280; font-weight: 500; }
.enba-card-detail-value { color: #374151; font-weight: 600; text-align: right; }
.enba-card-footer { padding: 15px 25px; background-color: #f9fafb; border-top: 1px solid #f3f4f6; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.enba-card-footer .prescription-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* --- Durum Göstergesi (Status Badge) --- */
.prescription-status-dot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; font-weight: 600; font-size: 12px; color: #fff; text-transform: capitalize; }
.prescription-status-dot.request-received { background-color: #3b82f6; }
.prescription-status-dot.approved, .prescription-status-dot.sent-to-curobo { background-color: #10b981; }
.prescription-status-dot.rejected { background-color: #ef4444; }
.prescription-status-dot.unknown { background-color: #6b7280; }

/* --- İşlem Butonları (Kart) --- */
.prescription-actions .button { margin: 0 !important; padding: 9px 18px !important; border-radius: 8px !important; border: 1px solid transparent !important; color: #fff !important; font-size: 13px !important; font-weight: 600 !important; cursor: pointer; transition: all 0.2s ease-in-out; text-shadow: none !important; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); line-height: 1.5 !important; }
.prescription-actions .button:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: translateY(-2px); }
.prescription-actions .view-prescription { background-color: #3b82f6 !important; }
.prescription-actions .download-pdf-btn { background-color: #10b981 !important; }
.prescription-actions .resend-to-api-btn { background-color: #f97316 !important; }

/* --- Modal Stilleri --- */
.enbarezept-modal-overlay { display: none; position: fixed; z-index: 10001; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.7); justify-content: center; align-items: center; }
.enbarezept-modal-content { background-color: #fff; padding: 0; width: 90%; max-width: 750px; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); position: relative; animation: fadeIn 0.3s ease-out; max-height: 85vh; display: flex; flex-direction: column; }
.enbarezept-modal-header { padding: 20px 30px; border-bottom: 1px solid #e5e7eb; }
.enbarezept-modal-header h4 { margin: 0; font-size: 20px; font-weight: 700; color: #111827; }
#enbarezept-modal-body { padding: 30px; overflow-y: auto; }
.enbarezept-modal-close { color: #9ca3af; position: absolute; top: 18px; right: 25px; font-size: 24px; cursor: pointer; transition: color 0.2s ease; background: none; border: none; }
#enbarezept-modal-body h5 { font-size: 16px; font-weight: 700; color: #374151; margin-top: 25px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; }
#enbarezept-modal-body h5:first-child { margin-top: 0; }

/* --- Modern Hasta Bilgi Kutusu --- */
.patient-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; }
.patient-info-item { display: flex; align-items: flex-start; gap: 12px; background-color: #f9fafb; padding: 12px; border-radius: 8px; border: 1px solid #f3f4f6; }
.patient-info-item .dashicons { color: #9ca3af; font-size: 20px; margin-top: 2px; }
.patient-info-item div { display: flex; flex-direction: column; }
.patient-info-item .info-label { font-size: 12px; color: #6b7280; font-weight: 500; margin-bottom: 2px; }
.patient-info-item .info-value { font-size: 14px; color: #111827; font-weight: 600; }

/* --- Form Cevapları Stilleri --- */
.form-data-box dl { display: grid; grid-template-columns: 1fr; gap: 15px; }
.form-data-box dt { font-weight: 600; color: #4b5563; font-size: 14px; }
.form-data-box dd { margin: 0; padding: 10px 15px; background-color: #f9fafb; border-left: 4px solid #d1d5db; border-radius: 4px; font-size: 14px; line-height: 1.6; }

/* --- Reddetme Nedeni Kutusu --- */
.rejection-reason-box { background-color: #fef2f2; border: 1px solid #fecaca; border-left-width: 5px; border-left-color: #ef4444; border-radius: 8px; padding: 15px 20px; margin-top: 25px; }
.rejection-reason-box h5 { color: #b91c1c; margin-top: 0; border-bottom-color: #fecaca; }
.rejection-reason-box p { margin: 0; color: #991b1b; font-size: 14px; line-height: 1.6; }

/* --- Doktor Notları Stilleri --- */
.doctor-notes-section .notes-list { max-height: 200px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px; margin-bottom: 15px; background-color: #f9fafb; }
.doctor-notes-section .no-notes { color: #6b7280; font-style: italic; }
.doctor-notes-section .note-item { padding: 12px; border-bottom: 1px solid #e5e7eb; }
.doctor-notes-section .note-item:last-child { border-bottom: none; }
.doctor-notes-section .note-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 12px; }
.doctor-notes-section .note-meta strong { color: #111827; }
.doctor-notes-section .note-meta .note-date { color: #6b7280; }
.doctor-notes-section .note-content { font-size: 14px; line-height: 1.6; color: #374151; }
.add-note-form textarea { width: 100%; min-height: 80px; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; margin-bottom: 10px; }
.add-note-form { text-align: right; }

/* --- Modern Modal Butonları --- */
.enbarezept-modal-actions { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e5e7eb; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
#rejection-reason-wrapper { flex-basis: 100%; }
#rejection-reason-wrapper label { font-weight: 600; margin-bottom: 8px; display: block; }
#rejection_reason { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.enbarezept-modal-actions .button { display: inline-flex !important; align-items: center; gap: 8px; font-size: 14px !important; font-weight: 700 !important; padding: 10px 20px !important; border-radius: 8px !important; border: none !important; transition: all 0.2s ease !important; }
.enbarezept-modal-actions .button:hover { transform: translateY(-2px); box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08) !important; }
.enbarezept-modal-actions .button.enbarezept-reject-btn { background-color: #fee2e2 !important; color: #b91c1c !important; }
.enbarezept-modal-actions .button.enbarezept-reject-btn:hover { background-color: #fecaca !important; }
.enbarezept-modal-actions .button.enbarezept-approve-btn { background-color: #d1fae5 !important; color: #065f46 !important; }
.enbarezept-modal-actions .button.enbarezept-approve-btn:hover { background-color: #a7f3d0 !important; }

/* --- Sayfalama Stilleri --- */
.enba-pagination { margin-top: 30px; text-align: center; }
.enba-pagination .page-numbers { list-style: none; padding: 0; margin: 0; display: inline-flex; gap: 5px; }
.enba-pagination .page-numbers li { display: inline; }
.enba-pagination .page-numbers a, .enba-pagination .page-numbers span { display: block; padding: 8px 14px; text-decoration: none; border: 1px solid #d1d5db; border-radius: 6px; color: #374151; font-weight: 600; background-color: #fff; transition: all 0.2s ease; }
.enba-pagination .page-numbers a:hover { background-color: #f3f4f6; border-color: #9ca3af; }
.enba-pagination .page-numbers .current { background-color: #3b82f6; color: #fff; border-color: #3b82f6; }

/* --- Toast Bildirim Stilleri --- */
#enbarezept-toast-container { position: fixed; top: 50px; right: 20px; z-index: 10002; display: flex; flex-direction: column; gap: 10px; }
.enbarezept-toast { padding: 16px 24px; border-radius: 8px; color: #fff; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.15); opacity: 0; transform: translateX(110%); transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.215, 0.610, 0.355, 1); min-width: 300px; }
.enbarezept-toast.show { opacity: 1; transform: translateX(0); }
.enbarezept-toast.toast-success { background-color: #10b981; }
.enbarezept-toast.toast-error { background-color: #ef4444; }

/* --- MOBİL UYUM --- */
@media (max-width: 900px) { .enba-card-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .doctor-dashboard-wrapper .enbarezept-tabs { flex-direction: column; gap: 0; border-bottom: none; } .doctor-dashboard-wrapper .enbarezept-tabs a { border-bottom: 1px solid #e5e7eb; border-radius: 6px; } .doctor-dashboard-wrapper .enbarezept-tabs a.active { border-bottom-color: #e5e7eb; background-color: #eef2ff; } }
