/* Font Imports (assuming Inter is linked in index.html head) */
/* If you want to use Linux Libertine, ensure the path is correct */
@font-face {
	font-family: "Linux Libertine";
	src: url("webfonts/bpicons.woff") format('woff'); /* Ensure this path is correct */
}

/* Base HTML and Body Styles */
html {
	font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Prefer Inter if linked */
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
	color: #e0e0e0; /* Light gray text for general content */
	font-size: 1em;
	line-height: 1.6; /* Improved readability */
}

body {
	text-align: right;
	user-select: none;
	margin: 0;
	background-color: #000; /* Light gray background for the entire page */
	display: flex; /* Use flexbox for main layout */
	min-height: 100vh; /* Ensure body takes full viewport height */
	flex-direction: column; /* Stack content vertically if needed */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
	width: 8px; /* Narrower scrollbar */
	height: 8px;
	direction: ltr; /* Scrollbar direction */
}
::-webkit-scrollbar-track {
	background: #e0e0e0; /* Light track */
	border-radius: 10px;
}
::-webkit-scrollbar-thumb {
	background: #888; /* Gray thumb */
	border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
	background: #555; /* Darker gray on hover */
}

/* General Resets and Utilities */
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary {
	display: block;
}
[hidden], template {
	display: none;
}
a:active, a:hover {
	cursor: pointer;
	outline: 0;
}
h1, h2, h3, h4, h5, h6 {
	color: #333; /* Darker text for headings in main content */
	background: none;
	font-weight: 600; /* Semi-bold */
	margin: 0;
	overflow: hidden;
	padding-top: 0.5em;
	padding-bottom: 0.17em;
}
img {
	border: 0;
	max-width: 100%;
	height: auto; /* Ensure images scale correctly */
}
hr {
	box-sizing: content-box;
	height: 0;
	display: block;
	border: 0;
	border-top: 1px solid #e0e0e0; /* Lighter border */
	margin: 1em 0;
	padding: 0;
}
input {
	line-height: normal;
}
td, th {
	padding: 0;
}
::-moz-selection {
	background: #b3d4fc;
	text-shadow: none;
}
::selection {
	background: #b3d4fc;
	text-shadow: none;
}
audio, canvas, iframe, img, svg, video {
	vertical-align: middle;
}
.hidden {
	display: none;
}
.invisible {
	visibility: hidden;
}
.clearfix:before, .clearfix:after {
	content: " ";
	display: table;
}
.clearfix:after {
	clear: both;
}
@media print {
	*, *:before, *:after, *:first-letter, *:first-line {
		background: transparent !important;
		color: #000 !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}
}

/* Article Headings */
.article h1 {
	font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
	border-bottom: 1px solid #d1d5db; /* Lighter border */
	font-size: 2.3em;
	color: #1a202c; /* Darker color for main headings */
}
.article h2 {
	font-size: 1.8em; /* Slightly larger */
	margin: 0.5em 0 0.5em 0;
	font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
	border-bottom: 1px solid #d1d5db;
	line-height: 1.4em;
	padding-bottom: 0em;
	color: #2d3748;
}
.article h3 {
	font-weight: 700; /* Bold */
	font-size: 1.4em; /* Slightly larger */
	color: #4a5568;
}
.article p.roleNote {
	padding: 1em 0 0 1.6em;
	font-style: italic;
	color: #6b7280;
}
p.siteSub {
	font-size: 92%;
	color: #9ca3af;
}

/* List Styles */
ul {
	list-style-type: none;
	list-style-image: none;
	margin: 0;
	padding: 0.3em 0 0 0;
}

/* Main Layout Structure */
.wrapAll {
    display: flex; /* تم إضافة Flexbox لإدارة تخطيط الشريط الجانبي والمحتوى الرئيسي */
    flex-direction: column; /* الافتراضي: تكديس عمودي على الشاشات الصغيرة */
    width: 97%;
    flex-grow: 1; /* يسمح للحاوية بأن تأخذ الارتفاع المتاح */
    padding: 1rem; /* إضافة مسافة بادئة حول الحاوية بأكملها */
    gap: 1rem; /* مسافة بين الشريط الجانبي والمحتوى الرئيسي */
}

/* Sidebar */
.sidebar {
    background-color: #1f2937;
    color: #e0e0e0;
    padding: 1.5rem;
    width: 100%; /* عرض كامل على الشاشات الصغيرة */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    flex-shrink: 0; /* منع الانكماش */
    /* تم إزالة float و position: absolute للسماح لـ Flexbox بإدارة الارتفاع */
}

.sidebar .logo {
	margin-bottom: 1.5rem; /* More space below logo */
	text-align: center;
	transition: transform 0.3s ease-in-out;
}
.sidebar .logo img {
	width: 8rem; /* Fixed width for logo */
	height: 8rem;
	border-radius: 9999px; /* Fully rounded */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.sidebar .logo:hover {
	transform: scale(1.05); /* Slight zoom on hover */
}
.sidebar .navigation {
	margin-top: 1rem;
	padding: 0;
}
.sidebar h3 {
	font-size: 1.25rem; /* Larger heading */
	color: #fcd34d; /* Yellow accent color */
	font-weight: 600;
	margin: 2rem 0 0.75rem 0; /* More vertical spacing */
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #4b5563; /* Lighter border */
	cursor: default;
	text-shadow: 0 0 10px rgba(255, 217, 0, 0.904);
}
.sidebar ul {
	padding: 0;
}
.sidebar li {
	line-height: 1.5em; /* Adjusted line height */
	margin-top: 0.5em;
	margin-bottom: 0.5em;
	padding: 0.5em 0;
	font-size: 0.9em; /* Slightly larger font */
	word-wrap: break-word;
}
.sidebar a, .sidebar a:visited {
	color: #d1d5db; /* Light gray for links */
	text-decoration: none;
	display: block; /* Make links block-level for better click area */
	padding: 0.5rem 0.75rem;
	border-radius: 0.375rem; /* Rounded link backgrounds */
	transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.sidebar .navigation a:hover {
	background-color: #374151; /* Darker background on hover */
}

/* Custom elements from original HTML */
.sidebar ul2 {
    /* ... */
    color: #fff; /* تم تغيير اللون ليتوافق مع ألوان Tailwind */
    display: flex;
    align-items: center;
    justify-content: space-between; /* جديد: يدفع المحتوى إلى الأطراف، مما يجعل السهم في أقصى اليسار */
    font-size: 1.1em; /* Adjusted font size */
    font-weight: 500;
    display: flex;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.sidebar ul2::before {
    content: none; /* جديد: التأكد من أن ::before لا يعرض أي شيء إذا لم يكن هو السهم */
}
.sidebar ul2::after {
    content: "⌄"; /* المؤشر (السهم) */
    transition: transform 0.2s ease-in-out; /* جديد: انتقال سلس لدوران السهم */
    display: inline-block; /* جديد: لضمان تطبيق التحويل بشكل صحيح */
}
.sidebar ul2:hover {
	color: #fff;
	background-color: #374151;
	cursor: pointer;
	transition: transform 0.2s ease-in-out;
}
.sidebar sc2 {
	font-size: 1em; /* Adjusted font size */
	display: block; /* Ensure it takes full width */
	padding-right: 1.5rem; /* Indent sub-links */
}
.sidebar sc2 a {
	padding: 0.3rem 0.5rem; /* Smaller padding for sub-links */
	font-size: 0.9em;
	color: #9ca3af; /* Lighter gray for sub-links */
}
.sidebar sc2 a:hover {
	background-color: #4b5563; /* Even darker background for sub-links on hover */
}

/* Search Box */
#filterBox {
	width: calc(85% - 20px); /* Adjust width to fit padding */
	height: 40px; /* Taller */
	text-align: right;

	color: #ffffff; /* White text */
	background-color: #374151; /* Darker background */
	border: 1px solid #4b5563; /* Darker border */
	border-radius: 0.5rem; /* More rounded */
	outline: none;
	transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
#filterBox::placeholder {
    color: #9ca3af; /* Placeholder color */
}
#filterBox:focus {
	border-color: #fcd34d; /* Yellow focus ring */
	box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Main Content Area */
.mainsection {
    flex-grow: 1; /* يسمح للقسم الرئيسي بأن يأخذ المساحة المتبقية */
    background: #1f2937;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    /* تم إزالة margin-left حيث يتم الآن إدارة المسافة بواسطة gap في .wrapAll */
}

/* Header Links (User Name and Fullscreen Button) */
.headerLinks {
	display: flex;
	justify-content: space-between; /* Space between user name and button */
	align-items: center;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e5e7eb; /* Light border */
	margin-bottom: 1.5rem;
	font-size: 1.125rem; /* Larger font size */
	color: #374151; /* Darker text color */
	font-weight: 600;
}
.headerLinks span {
	display: flex;
	align-items: center;
	gap: 0.5rem; /* Space between text and icon */
	margin-right: 0; /* Reset original margin */
	margin-left: 0; /* Reset original margin */
}
.headerLinks i {
	color: #fcd34d; /* Yellow icon */
}
#fullscreen-btn {
	padding: 0.75rem; /* Larger padding for button */
	border-radius: 9999px; /* Fully rounded */
	background-color: #e5e7eb; /* Light background */
	color: #4b5563; /* Dark gray icon */
	border: none;
	margin-right: 3px; 
	cursor: pointer;
	transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
#fullscreen-btn:hover {
	background-color: #d1d5db; /* Darker on hover */
	color: #1f2937;
	transform: scale(1.05);
}
#fullscreen-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.5); /* Gray glow */
}

/* Tabs Section */
.tabs {
	display: flex;
	flex-direction: column; /* Stack on small screens */
	justify-content: space-between;
	align-items: flex-start; /* Align items to start */
	margin-bottom: 1.5rem;
	gap: 1rem; /* Space between tab groups */
}
.tabs ul {
	display: flex;
	padding: 0;
	margin: 0;
	list-style: none;
	flex-wrap: wrap; /* Allow tabs to wrap */
}
.tabs ul li {
	margin: 0 0.5rem; /* Smaller margin between tabs */
	padding: 0;
}
.tabs ul li a {
	display: block;
	font-size: 0.95em; /* Slightly larger font */
	padding: 0.75rem 1.25rem; /* More padding */
	line-height: 1.5em;
	position: relative;
	top: 0; /* Remove original top: 1px */
	left: 0; /* Remove original left: 1px */
	border-bottom: none; /* Remove original border-bottom */
	border-radius: 0.375rem; /* Rounded corners for tabs */
	background-color: #f3f4f6; /* Light background for inactive tabs */
	color: #4b5563; /* Dark text for inactive tabs */
	transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.tabs ul li a.active {
	background-color: #fcd34d; /* Yellow background for active tab */
	color: #1f2937; /* Dark text for active tab */
	box-shadow: 0 2px 5px rgba(252, 211, 77, 0.5); /* Yellow shadow for active tab */
}
.tabs ul li a:hover:not(.active) {
	background-color: #e5e7eb; /* Darker light background on hover */
	color: #1f2937;
}

.tabsLeft, .tabsRight {
	float: none; /* Remove float for flexbox layout */
	line-height: normal;
}
.goframe {
	margin-right: 0; /* Reset original margin */
	background-color: #3b82f6 !important; /* Blue background for "Enter Frame" button */
	color: #ffffff !important; /* White text */
	box-shadow: 0 2px 5px rgba(59, 130, 246, 0.5); /* Blue shadow */
}
.goframe:hover {
	background-color: #2563eb !important; /* Darker blue on hover */
}

/* Article Section (Iframe Container) */
.article {
	flex-grow: 0; /* Allow article to take remaining vertical space */
	padding: 0; /* Remove padding here, iframe will handle its own padding */
	border: none; /* Remove borders, iframe will have its own styling */
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: top;
	overflow: hidden; /* Hide overflow if iframe is larger */
}
.article iframe {
	width: 100%;
	height: 90%;
	min-height: 600px; /* Minimum height for iframe */
	border: none;
	border-radius: 20px;
}

/* Page Footer */
.pagefooter {
	text-align: center;
	padding: 2rem 0; /* More padding */
	font-size: 0.875rem; /* Slightly larger font */
	line-height: 1.8;
	color: #6b7280; /* Gray text */
	border-top: 1px solid #e5e7eb; /* Light border at top */
	margin-top: 2rem; /* Space above footer */
}
.pagefooter a {
	display: inline-block;
	margin: 0 0.75rem; /* Spacing between links */
	color: #3b82f6; /* Blue links */
	text-decoration: none;
	transition: color 0.2s ease-in-out, text-decoration 0.2s ease-in-out;
}
.pagefooter a:hover {
	color: #2563eb; /* Darker blue on hover */
	text-decoration: underline;
}

/* Responsive Adjustments */
@media screen and (min-width: 768px) { /* Medium screens and up */
    .wrapAll {
        flex-direction: row; /* الشريط الجانبي والمحتوى الرئيسي جنبًا إلى جنب */
        /* تم إزالة padding و gap من هنا حيث يتم الآن تطبيقها على .wrapAll الرئيسي */
    }
    .sidebar {
        width: 16rem; /* عرض ثابت للشريط الجانبي على الشاشات الأكبر */
        /* تم إزالة margin حيث يتم الآن إدارته بواسطة gap في .wrapAll */
    }
    .mainsection {
        /* تم إزالة margin حيث يتم الآن إدارته بواسطة gap في .wrapAll */
    }
    .tabs {
        flex-direction: row; /* الألسنة جنبًا إلى جنب */
        align-items: center;
    }
}

@media screen and (max-width: 767px) { /* Small screens (mobile) */
	.sidebar {
		border-radius: 0.75rem; /* Rounded corners for sidebar */
	}
	.mainsection {
		border-radius: 0.75rem; /* Rounded corners for main section */
	}
	.headerLinks {
		flex-direction: column; /* Stack header elements */
		align-items: flex-end; /* Align to right */
		gap: 0.5rem;
	}
	.headerLinks span {
		margin-bottom: 0.5rem;
	}
	.tabs ul li {
		margin: 0.25rem; /* Smaller margin for wrapped tabs */
	}
}

/* Original elements that might not be used or need specific handling */
div.articleRight, div.articleRightInner, .contentsPanel, .contentsHeader, .hidePanel, .showPanel, .minimizedPanel {
	/* These were commented out or not present in the new structure */
	/* If you reintroduce them, they will need new styling */
	display: none; /* Hide them by default if not used */
}

/* Ensure original goframe margin is overridden */
.goframe {
	margin-right: 0px !important;
}

span {
	margin-right: 0px !important;
	margin-left: 0px !important;
}
