/* ===================================================================
   PRESCRIPTION GENERATOR WEB APPLICATION - STYLESHEET
   Version: 12.3.1
   Organized by: Functional Categories
   =================================================================== */

/* ==================== 1. GLOBAL & LAYOUT STYLES ==================== */
:root {
    --primary: #0d6efd;
    --primary-soft: #eef4ff;
    --success: #2fb344;
    --danger: #fa5252;
    --warning: #fab005;
    --neutral-bg: #f8fafc;
    --border-soft: #e5e7eb;
    --text-main: #1f2937;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    width: 100%;
    gap: 20px;
}

/* ==================== 2. TYPOGRAPHY & TEXT ==================== */
.dashboard-title {
    font-size: 24px;
    color: #0056b3;
    margin: 0;
}

.examination-heading {
    color: #0056b3;
    font-weight: bold;
    font-size: 11px;
    margin: 15px 0 5px 0;
}

.author-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.author-link:hover {
    color: #218838;
    text-decoration: underline;
}

/* ==================== 3. FORM & INPUT ELEMENTS ==================== */
.input-group {
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    min-height: 120px;
}

input, select, textarea {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

textarea {
    resize: none;
    margin-bottom: 5px;
}

.transaction-input {
    border: 2px solid #0056b3;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

#histSearch {
    margin: 10px 0;
    padding: 8px 12px;
    border: 2px solid #0056b3;
    border-radius: 20px;
    outline: none;
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
}

.medicine-autocomplete {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23666" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px !important;
    position: relative;
    z-index: 100;
}

.med-input {
    font-size: 12px;
    padding: 4px 6px;
}

.centered-input {
    text-align: center;
}

::placeholder {
    color: #666;
    font-family: 'Segoe UI', sans-serif;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #666;
    font-family: 'Segoe UI', sans-serif;
}

::-ms-input-placeholder {
    color: #666;
    font-family: 'Segoe UI', sans-serif;
}

/* ==================== 4. BUTTON STYLES ==================== */
/* Header Buttons */
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 80px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

#settingsBtn {
    background: linear-gradient(135deg, #7F5BD9, #59339D);
    color: white;
}

#settingsBtn:hover {
    background: linear-gradient(135deg, #6A4BC4, #4A2C87);
}

#clearBtn {
    background: linear-gradient(135deg, #FF6B6B, #E55353);
    color: white;
}

#clearBtn:hover {
    background: linear-gradient(135deg, #E55353, #CC4444);
}

#subscriptionBtn {
    background: linear-gradient(135deg, #2ECC71, #27AE60);
    color: white;
}

#subscriptionBtn:hover {
    background: linear-gradient(135deg, #27AE60, #1E8449);
}

/* Action Buttons */
.btn-add {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    min-width: 150px;
}

.btn-gen {
    background: linear-gradient(135deg, #0062CC, #003F8A) !important;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-gen:hover {
    background: linear-gradient(135deg, #0056B3, #003366) !important;
}

.btn-save {
    background: linear-gradient(135deg, #28A745, #218838);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    flex: 0 0 auto;
}

.btn-save:hover {
    background: linear-gradient(135deg, #218838, #1E7E34);
}

.btn-download {
    background: linear-gradient(45deg, #0056b3, #004085);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.3s;
    margin-top: 20px;
}

.btn-download:hover {
    background: linear-gradient(45deg, #004085, #002752);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-import {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.3s;
}

.btn-import:hover {
    background: linear-gradient(45deg, #218838, #1ca87a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-unlock {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s;
}

.btn-unlock:hover {
    background: linear-gradient(45deg, #218838, #1ca87a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/*UPGRADE TO PREMIUM BUTTON DANGER COLOR*/
/* ==================== 4. BUTTON STYLES ==================== */

/* Upgrade to Premium Button - DANGER/RED STYLE */
.btn-upgrade-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 48px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.btn-upgrade-danger:hover {
    background: linear-gradient(135deg, #c82333, #a71d2a) !important;
}

.btn-upgrade-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.btn-upgrade-danger:disabled {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Edit/Remove Buttons */
.btn-remove {
    color: #fff;
    border: none;
    background: #dc3545;
    cursor: pointer;
    font-weight: bold;
    font-size: 10px;
    border-radius: 3px;
    padding: 2px 8px;
    margin: 0;
}

.btn-edit {
    color: #fff;
    border: none;
    background: #0056b3;
    cursor: pointer;
    font-weight: bold;
    font-size: 10px;
    border-radius: 3px;
    padding: 4px 8px;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #004085;
}

.btn-edit-patient {
    background: #0056b3;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    font-size: 9px;
    width: 100%;
}

.btn-edit-prescription {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    font-size: 9px;
    width: 100%;
}

.undo-delete-btn {
    background: #6c757d !important;
}

.undo-delete-btn:hover {
    background: #5a6268 !important;
}

/* Export/Import Buttons */
.export-btn {
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

#importExportBtn {
    background: linear-gradient(135deg, #6C757D, #5A6268);
}

#importExportBtn:hover {
    background: linear-gradient(135deg, #5A6268, #495057);
}

#bulkPrintBtn {
    background: linear-gradient(135deg, #495057, #343A40);
}

#bulkPrintBtn:hover {
    background: linear-gradient(135deg, #343A40, #212529);
}

/* Button Containers */
.button-container {
    display: flex !important;
    gap: 20px !important;
    margin-top: 10px !important;
}

.button-container button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 48px;
    box-sizing: border-box;
}

/* Glass Button Design */
.btn-glass {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-glass:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.btn-glass:active {
    transform: scale(0.97);
}

/* ==================== 5. HISTORY SECTION STYLES ==================== */
.history-sidebar {
    flex: 1.2;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-width: 0;
    overflow: hidden;
}

#historyList {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.history-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    gap: 15px;
    border-bottom: 1px solid #e0e0e0 !important;
    transition: background 0.2s ease;
}

.history-item:last-child {
    border-bottom: none !important;
}

.history-item>div:first-child {
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    white-space: normal;
    font-weight: bold;
}

.history-item:hover {
    background: #eef6ff;
}

.history-buttons {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: space-between;
    gap: 0;
}

.history-buttons button {
    flex: 0 0 auto;
    height: 25px;
    width: calc(33.33% - 5px);
    margin: 0 2.5px;
}

.edit-mode-indicator {
    display: none;
    background: #0056b3;
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

.edit-mode-patient {
    background: #0056b3;
}

.edit-mode-prescription {
    background: #28a745;
}

/* ==================== 6. MEDICATION & PRESCRIPTION STYLES ==================== */
.med-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
}

.med-table th {
    font-size: 11px;
    text-align: left;
    color: #666;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.med-table td {
    padding: 4px;
}

#medicineTableContainer {
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row !important;
}

#prescriptionPreview {
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 5px;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
}

#previousPrescriptionsContainer {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

#previousPrescriptionsContainer label {
    font-weight: 600;
    color: #0056b3;
    margin-right: 10px;
}

#previousPrescriptionsDropdown {
    border: 1px solid #0056b3;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: #333;
    background: white;
    cursor: pointer;
}

#previousPrescriptionsDropdown:hover {
    border-color: #003d82;
}

#previousPrescriptionsDropdown:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

#addPrescriptionContainer {
    justify-content: center;
    text-align: center;
    align-items: center;
    min-height: 150px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin: 10px 0;
    margin: 20px 0;
    background: #fafafa;
}

#addPrescriptionBtn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

#addPrescriptionBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #218838, #1ca87a);
}

#addPrescriptionBtn:active {
    transform: translateY(0);
}

#addNewPrescriptionBtn {
    font-size: 11px;
    background-color: #6c757d;
    cursor: not-allowed;
}

/* ==================== 7. MEDICINE DATABASE & AUTOCOMPLETE ==================== */
datalist {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

datalist option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
}

datalist option:hover {
    background-color: #f0f0f0;
}

.medicine-suggestion:hover {
    background-color: #f0f0f0 !important;
}

input[list]::-webkit-calendar-picker-indicator {
    display: none;
}

.medicine-autocomplete::-webkit-list-button {
    display: none;
}

.database-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.stat-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 8px;
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #0056b3;
}

.stat-label {
    font-size: 11px;
    color: #666;
}

.csv-sample-link {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    margin-top: 5px;
}

.csv-sample-link:hover {
    background: #218838;
    color: white;
}

/* ==================== 8. MEDICINE PRESET STYLES ==================== */
.btn-preset {
    background: #EBF4DD;
    color: white;
    border: none;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    transition: all 0.3s ease;
    margin-top: 10px;
    flex: 0 0 auto;
}

.btn-preset:enabled {
    background: #F11A7B;
    cursor: pointer;
}

.btn-preset:enabled:hover {
    background: #982176;
    transform: translateY(-1px);
}

.btn-preset:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#loadPresetDropdown {
    font-size: 11px;
    padding: 0 10px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    align-content: right;
    flex: 1;
    min-width: 120px;
    height: 28px;
}

#loadPresetDropdown option[value=""] {
    color: #666;
}

.btn-load-small {
    background: #28a745;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.btn-load-small:hover {
    background: #218838;
}

.preset-modal-content {
    position: relative; /* Add this line */
	max-width: 400px !important;
    border-radius: 10px;
    overflow: hidden;
}

.preset-modal-body {
    padding: 30px 20px 20px 20px;
    text-align: center;
}

.preset-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #0056b3;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 20px;
    text-align: center;
}

.preset-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.preset-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.preset-list-item:last-child {
    border-bottom: none;
}

.preset-name {
    font-weight: bold;
    color: #333;
}

.preset-count {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.preset-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
}

.preset-remove-btn:hover {
    background: #c82333;
}

.no-presets-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    font-size: 12px;
}

.preset-management-section {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
}

.preset-info {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

/* ==================== 9. MODAL & DIALOG STYLES ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
#presetModal {
	align-items: center;
	justify-content: center;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
}
	
#closePresetModal{
	color: #333; 
	font-size: 30px; 
	padding: 0; 
	background: transparent; 
	border: none; 
	cursor: pointer; 
	position: absolute; 
	top: 11px; 
	right: 15px; 
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 10px;
}
.preset-modal-header{
	background: linear-gradient(135deg, #0056b3, #004085); 
	padding: 15px; 
	margin:20px 20px 0 20px; 
	border-bottom: none;
}

.modal-title {
    color: #0056b3;
    margin: 0;
    font-size: 22px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-save-settings {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    margin-right: 0;
}

#settingsModal {
    z-index: 1000;
}

#presetManagementModal {
    z-index: 1100;
}

#customAlertModal {
    z-index: 1200;
}

/* ==================== 10. SETTINGS MODAL COMPONENTS ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.settings-section h4 {
    color: #0056b3;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.settings-input {
    margin-bottom: 12px;
}

.settings-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
    font-size: 13px;
}

.logo-preview-container {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.logo-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    margin-top: 5px;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    background: #0056b3;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 12px;
}

.preview-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

/* ==================== 11. WATERMARK & SIGNATURE CONTROLS ==================== */
.watermark-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.watermark-controls input[type="range"] {
    flex: 1;
}

.watermark-value {
    min-width: 40px;
    text-align: center;
}

.signature-preview {
    width: 200px;
    height: 80px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    overflow: hidden;
}

.signature-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.signature-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-remove-signature {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
}

.btn-remove-signature:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.fontsize-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fontsize-value {
    min-width: 40px;
    text-align: center;
}

/* ==================== 12. PAYMENT & PREMIUM MODAL STYLES ==================== */
.premium-payment-card {
    background: linear-gradient(145deg, #ffffff, #f0f7ff);
    border: 1px solid #d0e3ff;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.05);
    position: relative;
    overflow: hidden;
}

.premium-payment-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #0056b3;
}

.method-badge {
    display: inline-block;
    background: #eef6ff;
    color: #0056b3;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.number-container {
    background: #ffffff;
    border: 2px dashed #0056b3;
    color: #0056b3;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin: 10px 0;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-container:hover {
    background: #0056b3;
    color: white;
    transform: translateY(-2px);
}

.provider-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.payment-section {
    background: #fff9e6;
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.payment-info {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.after-payment-box {
    background-color: #f8f9fa;
    border: 1.5px dashed #0056b3;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.after-payment-title {
    color: #0056b3;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.after-payment-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13.5px;
    color: #333;
    line-height: 1.6;
}

.after-payment-steps li {
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.step-number {
    background: #0056b3;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==================== 13. PACKAGE/PRODUCT CARD STYLES ==================== */
.package-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.package-card:hover {
    border-color: #28a745;
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.package-card.popular {
    border-color: #dc3545;
}

.package-card.best {
    border-color: #f39c12;
}

.pkg-count {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.pkg-price {
    font-size: 22px;
    font-weight: bold;
    color: #0056b3;
    margin: 5px 0;
}

.pkg-note {
    font-size: 12px;
    color: #666;
}

.badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 20px;
}

.badge.gold {
    background: #f39c12;
}

/* ==================== 14. IMPORT/EXPORT MODAL STYLES ==================== */
.import-export-options {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.option-card {
    background: white;
    border: 2px solid #0056b3;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: default;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.option-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #0056b3;
}

.option-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.option-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.file-drop-area {
    border: 3px dashed #0056b3;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fbff;
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.file-drop-area:hover {
    background: #e8f4ff;
    border-color: #28a745;
}

.file-drop-area.drag-over {
    background: #d4edff;
    border-color: #0056b3;
}

.file-drop-icon {
    font-size: 64px;
    color: #0056b3;
    margin-bottom: 15px;
}

.file-drop-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.file-drop-subtext {
    font-size: 14px;
    color: #666;
}

.uploaded-file-info {
    background: #e8f5e9;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 32px;
    color: #28a745;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.file-size {
    font-size: 13px;
    color: #666;
}

.export-info {
    background: #fff3cd;
    border: 2px dashed #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.export-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #0056b3;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.import-mode-container {
    margin: 25px 0;
    padding: 0;
}

.import-mode-title {
    color: #0056b3;
    margin-bottom: 20px;
    font-size: 18px;
    text-align: center;
}

.import-mode-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.import-mode-option {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.import-mode-option:hover {
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.import-mode-option.selected {
    border-color: #28a745;
    background: #f8fff9;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.15);
}

.import-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.import-mode-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.import-mode-icon {
    font-size: 24px;
    color: #0056b3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f7ff;
    border-radius: 50%;
}

.import-mode-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.import-mode-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-left: 52px;
}

.import-mode-check {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 24px;
    height: 24px;
    border: 2px solid #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.import-mode-option.selected .import-mode-check {
    opacity: 1;
    background: #28a745;
}

.import-mode-check::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.warning-note {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    padding: 12px;
    margin-top: 20px;
    font-size: 13px;
    color: #856404;
    text-align: center;
}

#alertCancelBtn.hidden {
    display: none !important;
}

/* ==================== 15. STATUS & MESSAGE STYLES ==================== */
.status-message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 12px;
    display: none;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block !important;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block !important;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block !important;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.counter-display {
    text-align: center;
    margin: 10px 0;
    padding: 8px;
    background: #e9f7fe;
    border-radius: 5px;
    border: 1px solid #b6e0fe;
    font-size: 14px;
    color: #0056b3;
}

/* ==================== 16. PREMIUM & PRO BADGE STYLES ==================== */
.pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 12px 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    background: red;
    border-radius: 4px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: default;
    margin-left: 5px;
	top: -1px;
}

.pro-badge::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(30deg);
    transition: none;
    animation: cyberScan 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes cyberScan {
    0% {
        left: -60%;
    }

    20% {
        left: 120%;
    }

    100% {
        left: 120%;
    }
}

.premium-active {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #000 !important;
    font-weight: bold !important;
}

/* ==================== 17. UTILITY & MISC STYLES ==================== */
.main-form {
    flex: 3;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: hidden;
}

.header-row {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#bkash,
#nagad {
    width: 25px;
    height: 25px;
}

#rocket {
    width: 35px;
    height: 35px;
}

/* ==================== 18. ANIMATIONS & TRANSITIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

/* ==================== 19. RESPONSIVE DESIGN ==================== */
/* Tablet and Mobile Responsive */
@media screen and (max-width: 992px) {

    /*PRO Badge Design*/
	.pro-badge {
		height: 18px;
		padding: 5px 10px 5px 10px;
		font-size: 15px;
		font-weight: 800;
		letter-spacing: 1px;
		border-radius: 20px;
		margin-left: 5px;
		top: -5px;
	}
	
	
	/* 1. RESET BODY LAYOUT FOR SCROLLING */
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px;
        display: block;
    }

    /* 2. STACK MAIN CONTAINERS */
    .dashboard-container {
        flex-direction: column;
        gap: 15px;
        height: auto;
        width: 100%;
        overflow-x: hidden;
    }

    .main-form,
    .history-sidebar {
        width: 100%;
        flex: none;
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 15px;
        box-sizing: border-box;
    }

    /* 3. HEADER WITH CENTERED BUTTONS */
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        margin-bottom: 15px;
        width: 100%;
    }

    .dashboard-title {
        font-size: 36px;
        text-align: center;
        width: 100%;
        margin-bottom: 10px;
    }

    .header-container>div {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: 100%;
        flex-wrap: nowrap;
    }

    /* 4. PATIENT INFO INPUTS - STACK VERTICALLY */
    .header-row {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .header-row input,
    .header-row select {
        width: 100% !important;
        flex: 1 1 100% !important;
        padding: 10px;
        box-sizing: border-box;
        margin: 0 !important;
    }

    /* 5. CLINICAL & MEDICINE COLUMNS - STACK VERTICALLY */
    .main-form>div[style*="display: flex; gap: 20px"] {
        flex-direction: column !important;
        gap: 15px !important;
        width: 100%;
    }

    /* 6. PULSE/BP/TEMP INPUTS - SIDE BY SIDE */
    .input-group>div[style*="display:flex; gap:5px"] {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100%;
        flex-wrap: nowrap;
    }
	
	#counterDisplay{
		margin-bottom: 15px;
	}
	
    #pulseInput,
    #bpInput,
    #tempInput {
        flex: 1;
        min-width: 0;
        text-align: center;
        padding: 8px 4px;
    }

    /* 7. MEDICINE TABLE - HORIZONTAL SCROLL */
    #invesContainer{
		margin-top: 15px !important;
	}
	#medicineTableContainer {
        display: block !important;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;

        border: 1px solid #eee;
        border-radius: 4px;
        padding: 5px;
        box-sizing: border-box;
    }
	.medContainer{
		margin-top: -10px;
	}

    .med-table {
        min-width: 800px;
    }

    .med-table select,
    .med-table input {
        padding: 6px 4px;
        font-size: 12px;
    }

    /* 8. MEDICINE BUTTONS - SMALLER HEIGHT */
    #medicineTableContainer+div {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px !important;
        align-items: center;
    }

    #medicineTableContainer+div>button,
    #medicineTableContainer+div>select {
        padding: 6px 10px !important;
        height: 32px !important;
        font-size: 11px !important;
        margin: 0 !important;
        flex: 1 1 calc(50% - 4px);
        box-sizing: border-box;
        min-height: unset !important;
    }

    .btn-preset {
        height: 32px !important;
        padding: 6px 10px !important;
        min-height: unset !important;
    }

    #loadPresetDropdown {
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
    }

    /* 9. SAVE/GENERATE BUTTONS - SIDE BY SIDE */
    .button-container {
        flex-direction: row !important;
        gap: 10px !important;
        margin-top: 15px !important;
        width: 100%;
        display: flex !important;
    }

    .btn-save,
    .btn-gen {
        flex: 1;
        padding: 5px;
        font-size: 12px;
        min-height: 25px;
        box-sizing: border-box;
        width: auto !important;
		border-radius: 3px;
    }

    /* 10. HISTORY SIDEBAR ADJUSTMENTS */
    .history-sidebar {
        border-top: 3px solid #0056b3;
        padding-top: 15px;
        max-height: 500px;
        overflow-y: auto;
    }

    /* 11. MODAL ADJUSTMENTS FOR MOBILE */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 15px;
        margin: 10px;
        box-sizing: border-box;
    }

    /* Stack settings columns vertically */
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .payment-card-container {
        grid-template-columns: 1fr;
    }

    /* 12. SETTINGS MODAL BUTTONS - CENTERED */
    .modal-footer {
        justify-content: center !important;
        text-align: center !important;
    }

    .modal-footer .btn-cancel,
    .modal-footer .btn-save-settings {
        margin: 0 5px;
        min-width: 120px;
    }

    /* 13. CUSTOM ALERT MODAL - MOBILE OPTIMIZATION */
    #customAlertModal .modal-content {
        width: 90%;
        max-width: 400px;
        padding: 0;
        margin: 10px;
    }

    #customAlertModal .modal-header {
        padding: 15px 20px;
    }

    #customAlertModal .modal-title {
        font-size: 18px;
    }

    #customAlertModal .modal-body {
        padding: 20px;
    }

    #alertBigIcon {
        font-size: 48px;
        margin-bottom: 10px;
    }

    #alertMessage {
        font-size: 14px;
        padding: 10px;
        line-height: 1.4;
    }

    #customAlertModal .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    #alertCancelBtn,
    #alertConfirmBtn {
        width: 100%;
        padding: 12px;
        margin: 0;
        min-width: auto;
    }

    /* Make modal more touch-friendly */
    #closeAlertModal {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        padding: 0;
    }

    /* Ensure modal is properly centered on mobile */
    .modal {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
        overflow-y: auto;
    }

    #customAlertModal {
        align-items: center;
    }
	.history-item .patient-info {
        font-weight: 700 !important;
        font-style: normal !important;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 768px) {
    .button-container {
        flex-direction: column !important;
    }

    .button-container button {
        width: 100%;
        margin-bottom: 10px;
    }
	.history-item .patient-info {
        font-weight: 700 !important;
        font-style: normal !important;
    }
	.pro-badge {
		height: 18px;
		padding: 5px 10px 5px 10px;
		font-size: 15px;
		font-weight: 800;
		letter-spacing: 1px;
		border-radius: 20px;
		margin-left: 5px;
		top: -5px;
	}
}

/* Extra Small Mobile Devices */
@media screen and (max-width: 480px) {
    .header-btn {
        flex: 1;
        min-width: 100px;
        margin: 2px;
    }

    .header-container>div {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
    }

    .header-btn {
        width: auto;
        flex: 0 1 auto;
        min-width: 80px;
        margin-bottom: 0;
    }

    .input-group>div[style*="display:flex; gap:5px"] {
        flex-wrap: wrap;
    }

    #pulseInput,
    #bpInput,
    #tempInput {
        flex: 1 1 30%;
        min-width: 80px;
    }

    .button-container {
        flex-direction: row !important;
        display: flex !important;
    }

    .btn-save,
    .btn-gen {
        width: auto;
        flex: 1;
    }

    #medicineTableContainer+div>button,
    #medicineTableContainer+div>select {
        flex: 1 1 100%;
    }

    .export-btn {
        padding: 5px 8px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 10px;
        font-weight: bold;
		height: 28px;
    }

    #customAlertModal .modal-content {
        width: 95%;
        max-width: 350px;
    }

    #customAlertModal .modal-header {
        padding: 12px 15px;
    }

    #customAlertModal .modal-title {
        font-size: 16px;
    }

    #alertBigIcon {
        font-size: 40px;
    }

    #alertMessage {
        font-size: 13px;
    }

    #alertCancelBtn,
    #alertConfirmBtn {
        padding: 10px;
        font-size: 14px;
    }
	.btn-add,
	.btn-preset,
	.loadPresetDropdown	{
		padding: 5px 10px;
		border-radius: 2px;
		cursor: pointer;
		margin-top: 8px;
		margin-bottom: 5px;
		font-weight: bold;
		min-width: 120px;
		height:auto;
	}
	.preset-modal-body {
		padding: 30px 30px 20px 30px;
		text-align: center;
	}
	.preset-modal-header{
		margin: 30px 30px 0 30px;
	}
	.history-item .patient-info {
        font-weight: 700 !important;
        font-style: normal !important;
    }
	
	.pro-badge {
		height: 18px;
		padding: 5px 10px 5px 10px;
		font-size: 15px;
		font-weight: 800;
		letter-spacing: 1px;
		border-radius: 20px;
		margin-left: 5px;
		top: -5px;
	}
}

/* Fix any overflow issues */
* {
    max-width: 100%;
}

/* Large Desktop Adjustment */
@media (max-width: 1200px) {
    .dashboard-container {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .main-form,
    .history-sidebar {
        flex: none;
        width: 100%;
    }

    .history-sidebar {
        margin-top: 5px;
    }
	.history-item .patient-info {
        font-weight: 700 !important;
        font-style: normal !important;
    }
	
	.pro-badge {
		height: 18px;
		padding: 5px 10px 5px 10px;
		font-size: 15px;
		font-weight: 800;
		letter-spacing: 1px;
		border-radius: 20px;
		margin-left: 5px;
		top: -5px;
	}
}
