/* APC Bawabaati Frontend CSS */

/* Base overrides just for the portal elements */
:root {
	--apcbw-primary: #1A8EC5;
	--apcbw-dark: #0F6FA0;
	--apcbw-deeper: #0A4F75;
	--apcbw-bg: #f4f6f8;
	--apcbw-white: #ffffff;
	--apcbw-text: #333333;
	--apcbw-border: #e2e8f0;
	--apcbw-radius: 12px;
	--apcbw-radius-lg: 24px;
	--apcbw-radius-xl: 32px;
	--apcbw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--apcbw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.apcbw-hidden {
	display: none !important;
}

/* ==========================================
   LOGIN MODAL
   ========================================== */
#apcbw-login-overlay {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(10, 79, 117, 0.85);
	backdrop-filter: blur(5px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	direction: rtl;
	font-family: 'Cairo', sans-serif;
}

.apcbw-login-modal {
	background: var(--apcbw-white);
	width: 90%;
	max-width: 400px;
	border-radius: var(--apcbw-radius-xl);
	padding: 40px 30px;
	position: relative;
	box-shadow: var(--apcbw-shadow-lg);
	text-align: center;
}

.apcbw-modal-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: none;
	border: none;
	font-size: 28px;
	color: #999;
	cursor: pointer;
	line-height: 1;
}

.apcbw-modal-close:hover {
	color: #333;
}

.apcbw-login-header .apcbw-icon {
	font-size: 48px;
	display: block;
	margin-bottom: 10px;
}

/* SVG variant of the modal header icon */
.apcbw-login-header .apcbw-icon-svg {
	line-height: 0;
}
.apcbw-pass-toggle svg {
	display: block;
}

.apcbw-login-header h3 {
	margin: 0 0 5px 0;
	color: var(--apcbw-deeper);
	font-weight: 700;
	font-size: 22px;
}

.apcbw-login-header p {
	margin: 0 0 30px 0;
	color: #666;
	font-size: 14px;
}

.apcbw-form-group {
	margin-bottom: 20px;
	text-align: right;
}

.apcbw-form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;
	color: var(--apcbw-text);
}

.apcbw-form-group input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid var(--apcbw-border);
	border-radius: var(--apcbw-radius);
	font-size: 15px;
	font-family: inherit;
	box-sizing: border-box;
}

.apcbw-form-group input:focus {
	outline: none;
	border-color: var(--apcbw-primary);
	box-shadow: 0 0 0 3px rgba(26, 142, 197, 0.2);
}

.apcbw-password-wrap {
	position: relative;
}

.apcbw-pass-toggle {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 18px;
	color: #999;
	cursor: pointer;
}

.apcbw-btn-submit {
	width: 100%;
	background: var(--apcbw-primary);
	color: #fff;
	border: none;
	padding: 14px;
	border-radius: var(--apcbw-radius);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s;
	font-family: inherit;
	margin-top: 10px;
}

.apcbw-btn-submit:hover {
	background: var(--apcbw-dark);
}

.apcbw-btn-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.apcbw-login-footer {
	margin-top: 25px;
	font-size: 13px;
	color: #666;
	line-height: 1.6;
}

.apcbw-msg {
	margin: 15px 0;
	font-size: 14px;
	color: #d32f2f;
	display: none;
}
.apcbw-btn-text {
	background: none; border: none; color: var(--apcbw-primary); cursor: pointer; text-decoration: underline; font-family: inherit; font-size:14px;
}

/* ==========================================
   DASHBOARD
   ========================================== */
.apcbw-dashboard {
	max-width: 1200px;
	margin: 20px auto 60px auto;
	direction: rtl;
	font-family: 'Cairo', sans-serif;
	padding: 0 20px;
}

.apcbw-page-title {
	text-align: center;
	font-size: 36px;
	color: var(--apcbw-deeper);
	margin-bottom: 40px;
	font-weight: 800;
}

.apcbw-patient-hero {
	background: linear-gradient(135deg, var(--apcbw-deeper) 0%, var(--apcbw-primary) 100%);
	color: #fff;
	border-radius: var(--apcbw-radius-xl);
	padding: 40px;
	box-shadow: var(--apcbw-shadow-lg);
	margin-bottom: 40px;
	position: relative;
	overflow: hidden;
}

.apcbw-hero-header h2 {
	margin: 0 0 10px 0;
	font-size: 32px;
	color: #fff;
}

.apcbw-mrn {
	display: inline-block;
	background: rgba(255,255,255,0.2);
	backdrop-filter: blur(5px);
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 14px;
	margin-bottom: 30px;
	border: 1px solid rgba(255,255,255,0.3);
}

.apcbw-info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	border-top: 1px solid rgba(255,255,255,0.2);
	padding-top: 30px;
}

.apcbw-info-item {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 16px;
	padding: 15px 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	transition: transform 0.2s, background 0.2s;
}

.apcbw-info-item:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
}

.apcbw-icon-glass {
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	flex-shrink: 0;
}

.apcbw-info-text {
	display: flex;
	flex-direction: column;
}

.apcbw-info-label {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 4px;
}

.apcbw-info-val {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
}

.apcbw-logout-wrap {
	position: absolute;
	top: 40px;
	left: 40px;
}

.apcbw-btn-logout {
	background: rgba(255,255,255,0.2);
	backdrop-filter: blur(5px);
	color: #fff;
	text-decoration: none;
	padding: 10px 20px;
	border-radius: 20px;
	font-size: 15px;
	font-weight: bold;
	border: 1px solid rgba(255,255,255,0.3);
	transition: all 0.2s;
}

.apcbw-btn-logout:hover {
	background: rgba(255,255,255,0.3);
	color: #fff;
}

.apcbw-visits-section h3 {
	margin: 0 0 25px 0;
	color: var(--apcbw-deeper);
	font-size: 24px;
}

.apcbw-visit-card {
	background: #fff;
	border: 1px solid var(--apcbw-border);
	border-radius: var(--apcbw-radius-lg);
	padding: 20px;
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 4px rgba(0,0,0,0.02);
	transition: transform 0.2s, box-shadow 0.2s;
}

.apcbw-visit-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--apcbw-shadow);
}

.apcbw-visit-date {
	flex: 1;
}
.apcbw-files-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
	margin-top: 15px;
}
.apcbw-file-card {
	border: 1px solid var(--apcbw-border);
	border-radius: var(--apcbw-radius-lg);
	padding: 20px 15px;
	text-align: center;
	background: #fff;
	transition: box-shadow 0.2s, transform 0.2s;
	display: flex;
	flex-direction: column;
	align-items: center;
}
.apcbw-file-card:hover {
	box-shadow: var(--apcbw-shadow);
	transform: translateY(-2px);
}
.apcbw-file-icon-wrap {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 15px;
}
.apcbw-file-icon-wrap svg {
	width: 26px; height: 26px;
}
.apcbw-file-type {
	font-weight: 700;
	font-size: 16px;
	color: var(--apcbw-deeper);
	margin-bottom: 20px;
}
.apcbw-file-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	width: 100%;
	margin-top: auto;
}
.apcbw-file-actions .apcbw-btn-view {
	flex: 1;
	font-size: 13px;
	padding: 8px 0;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

/* Lightbox UI */
#apcbw-lightbox {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.9);
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.apcbw-lightbox-close {
	position: absolute;
	top: 20px; right: 30px;
	color: #fff;
	font-size: 40px;
	cursor: pointer;
}
#apcbw-lightbox-img {
	max-width: 90%;
	max-height: 90vh;
	border-radius: 4px;
	box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Empty State (Logged Out / Errors) */
.apcbw-empty-state {
	background: #fff;
	border-radius: var(--apcbw-radius-xl);
	padding: 60px 20px;
	text-align: center;
	box-shadow: var(--apcbw-shadow-lg);
	max-width: 600px;
	margin: 40px auto;
	border: 1px solid var(--apcbw-border);
}
.apcbw-empty-icon {
	color: var(--apcbw-primary);
	margin-bottom: 20px;
	background: #E6F4FB;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.apcbw-empty-title {
	font-size: 26px;
	color: var(--apcbw-deeper);
	margin-bottom: 15px;
	font-weight: 800;
}
.apcbw-empty-desc {
	font-size: 16px;
	color: #666;
	line-height: 1.6;
	margin-bottom: 30px;
}
.apcbw-btn-primary-large {
	background: var(--apcbw-primary);
	color: #fff;
	border: none;
	padding: 14px 30px;
	border-radius: var(--apcbw-radius-lg);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
	display: inline-block;
}
.apcbw-btn-primary-large:hover {
	background: var(--apcbw-dark);
	transform: translateY(-2px);
}

.apcbw-date {
	display: block;
	font-weight: 700;
	color: var(--apcbw-deeper);
	font-size: 16px;
}

.apcbw-time {
	display: block;
	color: #777;
	font-size: 13px;
}

.apcbw-visit-details {
	flex: 2;
}

.apcbw-visit-details strong {
	display: block;
	font-size: 16px;
	color: var(--apcbw-text);
}

.apcbw-doctor {
	color: var(--apcbw-primary);
	font-size: 14px;
}

.apcbw-btn-view {
	background: none;
	border: 1px solid var(--apcbw-primary);
	color: var(--apcbw-primary);
	padding: 8px 16px;
	border-radius: 20px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
}

.apcbw-btn-view:hover {
	background: var(--apcbw-primary);
	color: #fff;
}

/* Modals */
.apcbw-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.6);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.apcbw-modal-content {
	background: #fff;
	width: 100%;
	max-width: 600px;
	border-radius: var(--apcbw-radius-lg);
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}

.apcbw-modal-header {
	padding: 20px;
	border-bottom: 1px solid var(--apcbw-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.apcbw-modal-header h3 {
	margin: 0;
	color: var(--apcbw-deeper);
}

.apcbw-modal-body {
	padding: 20px;
	overflow-y: auto;
}

.apcbw-notes-box {
	background: #fffdf5;
	border: 1px solid #ffeba1;
	padding: 15px;
	border-radius: var(--apcbw-radius);
	margin-bottom: 20px;
}

.apcbw-notes-box h4 {
	margin: 0 0 10px 0;
	color: #b78a00;
}

.apcbw-notes-box p {
	margin: 0;
	color: #555;
	line-height: 1.6;
}

/* Notices */
.apcbw-notice {
	padding: 15px;
	border-radius: var(--apcbw-radius);
	margin-bottom: 20px;
	text-align: center;
}
.apcbw-notice-info { background: #e3f2fd; color: #1565c0; }
.apcbw-notice-warning { background: #fff3e0; color: #e65100; }
.apcbw-notice-error { background: #ffebee; color: #c62828; }

@media (max-width: 600px) {
	.apcbw-visit-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
	.apcbw-btn-view {
		width: 100%;
	}
	.apcbw-logout-wrap {
		position: static;
		margin-top: 20px;
	}
}
