/**
 * UAE Law Archive - Government Style Theme
 * Updated to match index.html design
 */

/* ============================================
   CSS Variables (matching index.html)
   ============================================ */
:root {
  --bg-primary: #f5f5f5;
  --bg-white: #FFFFFF;
  --bg-dark: #1a1a2e;
  --color-primary: #0d4f8b;
  --color-primary-dark: #1a365d;
  --color-gold: #c9a227;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0e0e0;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --container-max: 1200px;
}

/* ============================================
   Hide Old vBulletin Elements
   ============================================ */
header.main-header + header.main-header,
.main-header + .top-bar-s,
.top-bar-s,
.header-s,
.in-footer-s,
.botto-foot-maz,
.topbar {
  display: none !important;
}

/* ============================================
   FORUM TO LEGAL DOCUMENT TRANSFORMATION
   Hide all forum/chat elements, keep only content
   ============================================ */

/* Hide User/Profile Elements */
.bigusername,
.smallfont:has(.bigusername),
td.alt2[width="175"],
td[width="175"].alt2,
.postbit-user,
.postbitlegacy .userinfo,
div[id^="postmenu_"],
.member-info,
#postmenu_76,
td.alt2:has(a.bigusername) {
  display: none !important;
}

/* Hide Forum Navigation & Controls */
.nav-bar-mob,
.navba-nav,
.up-navbar,
.vbmenu_control,
.tborder.nav-bar-mob,
.pagenav,
.navbar,
[class*="vbmenu"],
#threadtools,
#displaymodes,
.tborder:has(.navbar),
.tborder:has(.vbmenu_control) {
  display: none !important;
}

/* Hide Login/Registration Forms */
form[action*="login.php"],
form[action*="register.php"],
.login-s,
.login-s-2,
.login-s-3,
.panelsurround,
.fieldset:has(input[type="password"]),
table:has(input[name="vb_login_username"]),
.tborder:has(form[action*="login"]) {
  display: none !important;
}

/* Hide Post Controls & Buttons */
img[src*="reply.gif"],
img[src*="quote.gif"],
img[src*="report.gif"],
img[src*="edit.gif"],
img[src*="delete.gif"],
a[href*="newreply.php"],
a[href*="editpost.php"],
a[href*="report.php"],
.post-controls,
.postfoot,
#qr_open,
#qrform,
.postcounter,
td.thead:has(a[href*="showpost.php"]) {
  display: none !important;
}

/* Hide User Signatures & Profile Info */
.signature,
.usersig,
[class*="signature"],
div:has(> .smallfont:contains("Member")),
.smallfont:has(div:contains("المشاركات")),
.smallfont:has(div:contains("تاريخ التسجيل")) {
  display: none !important;
}

/* Hide Forum Breadcrumbs & Navigation */
.navbits,
#breadcrumb,
.breadcrumb,
img[src*="navbits"],
td:has(img[src*="navbits"]) {
  display: none !important;
}

/* Hide Social/Share Buttons */
#addthis,
[class*="addthis"],
script[src*="addthis"],
.social-share,
p:has(img[src*="addthis"]) {
  display: none !important;
}

/* Hide RSS/XML Links */
span:has(a[href*="external.php"]),
a[href*="external.php?type=rss"],
a[title="RSS"],
a[title*="RSS"],
div:has(> a[href*="external.php"]) {
  display: none !important;
}

/* Hide Forum Dropdowns */
select[name="f"],
select[name="langid"],
.smallfont:has(select),
table:has(select[name="f"]),
td:has(select[name="langid"]) {
  display: none !important;
}

/* Hide Old Flash/Object Elements */
object,
embed,
table:has(object),
table:has(embed) {
  display: none !important;
}

/* Hide Time/Date Stamps (forum style) */
.smallfont:has(.time),
span.time,
.thead:has(img[src*="statusicon"]) {
  display: none !important;
}

/* Hide Post Headers with dates */
td.thead[style*="font-weight:normal"] {
  display: none !important;
}

/* Hide "Page X of Y" pagination */
td:has(.pagenav),
div.pagenav,
.page-nav {
  display: none !important;
}

/* Hide Post Numbering */
a[id^="postcount"],
#postcount76,
td.thead:has(a[id^="postcount"]) {
  display: none !important;
}

/* ============================================
   STYLE THE LEGAL CONTENT
   ============================================ */

/* Main Content Area Styling */
.page-wrapper {
  background: #f5f5f5 !important;
  padding: 20px 0 !important;
  min-height: calc(100vh - 300px);
}

.page {
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08) !important;
  padding: 30px !important;
  max-width: 1000px !important;
  margin: 0 auto !important;
}

/* Post Content Styling - The Actual Legal Text */
#post_message_76,
div[id^="post_message_"],
.alt1[id^="td_post_"],
td.alt1:has(div[id^="post_message_"]) {
  background: #fff !important;
  padding: 30px !important;
  font-family: 'Tajawal', sans-serif !important;
  font-size: 17px !important;
  line-height: 2 !important;
  color: #333 !important;
  text-align: justify !important;
  border: none !important;
  width: 100% !important;
  display: block !important;
}

/* Style legal text content */
div[id^="post_message_"] {
  max-width: 900px !important;
  margin: 0 auto !important;
}

div[id^="post_message_"] font {
  font-family: 'Tajawal', sans-serif !important;
  line-height: 2 !important;
}

/* Make sure post content tables are full width */
table[id^="post"] {
  width: 100% !important;
  border: none !important;
  background: #fff !important;
}

table[id^="post"] > tbody > tr:first-child {
  display: none !important; /* Hide the post header row */
}

/* Style the post container */
#posts {
  background: #fff !important;
  border-radius: 12px !important;
  padding: 40px !important;
  margin: 20px auto !important;
  max-width: 1000px !important;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08) !important;
}

/* Thread Title Styling */
strong:has(+ hr),
.smallfont:has(strong) strong {
  font-size: 24px !important;
  color: #0d4f8b !important;
  font-weight: 700 !important;
  display: block !important;
  margin-bottom: 20px !important;
  padding-bottom: 15px !important;
  border-bottom: 3px solid #c9a227 !important;
}

/* Hide the HR after title */
hr[size="1"] {
  display: none !important;
}

/* Hide icon next to title */
.smallfont img.inlineimg {
  display: none !important;
}

/* ============================================
   CATEGORY/FORUM PAGES (f*.html) STYLING
   ============================================ */

/* Hide thread listing headers */
.thead,
.tcat {
  background: #0d4f8b !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: 15px !important;
  font-size: 16px !important;
}

/* Style thread/topic listings */
.alt1, .alt2 {
  background: #fff !important;
  border-bottom: 1px solid #eee !important;
  padding: 15px !important;
}

.alt1:hover, .alt2:hover {
  background: #f8f9fa !important;
}

/* Thread links styling */
a[id^="thread_title_"],
a[href*="showthread.php"],
a[href*=".html"]:not([href*="index"]):not([href*="search"]) {
  color: #0d4f8b !important;
  font-weight: 500 !important;
  font-size: 16px !important;
}

a[id^="thread_title_"]:hover,
a[href*="showthread.php"]:hover {
  color: #1a365d !important;
  text-decoration: underline !important;
}

/* Hide forum statistics */
.tfoot,
td.tfoot,
.smallfont:has(strong:contains("إحصائيات")),
div:has(.smallfont:contains("الأعضاء")) {
  display: none !important;
}

/* ============================================
   HIDE ADDITIONAL FORUM ELEMENTS
   ============================================ */

/* Hide post count, join date columns */
td.alt2[align="center"]:has(.smallfont) {
  display: none !important;
}

/* Hide thread icons */
img[src*="thread"],
img[src*="folder"],
img[src*="statusicon"],
img[alt*="Thread"] {
  display: none !important;
}

/* Hide moderation checkboxes */
input[type="checkbox"][name*="thread"],
input[type="checkbox"][name*="post"] {
  display: none !important;
}

/* Clean up nested tables */
.tborder {
  background: transparent !important;
  border: none !important;
}

/* Hide the main content wrapper excess */
div[align="center"] > div.page {
  width: 100% !important;
  max-width: 1000px !important;
}

/* ============================================
   MAKE PAGES LOOK LIKE LEGAL DOCUMENTS
   ============================================ */

/* Legal document wrapper */
.law-document {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.law-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 3px solid #c9a227;
}

.law-header h1 {
  color: #0d4f8b;
  font-size: 28px;
  margin-bottom: 15px;
}

.law-meta {
  color: #666;
  font-size: 14px;
}

.law-meta span {
  margin: 0 15px;
}

.law-content {
  line-height: 2;
  font-size: 17px;
  text-align: justify;
}

.law-content h2,
.law-content h3 {
  color: #0d4f8b;
  margin-top: 30px;
  margin-bottom: 15px;
}

/* Category page styling */
.category-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px;
}

.category-page h1 {
  color: #0d4f8b;
  font-size: 28px;
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 3px solid #c9a227;
}

.laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.law-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.law-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.law-card h3 {
  color: #0d4f8b;
  margin-bottom: 10px;
  font-size: 16px;
}

.law-card p {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
}

.law-card a {
  color: #c9a227;
  font-weight: 500;
}

/* ============================================
   Base Styles
   ============================================ */
* { box-sizing: border-box; }

body {
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  direction: rtl;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-dark);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Top Bar
   ============================================ */
.top-bar {
  background-color: #1a1a2e;
  color: white;
  padding: 8px 0;
  font-size: 14px;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-links {
  display: flex;
  gap: 20px;
}

.top-bar-links a {
  color: rgba(255,255,255,0.8);
}

.top-bar-links a:hover {
  color: white;
}

.language-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
}

.language-toggle a {
  color: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 4px;
}

.language-toggle a.active {
  background: rgba(255,255,255,0.2);
  color: white;
}

.language-toggle span {
  color: rgba(255,255,255,0.5);
}

/* ============================================
   Main Header
   ============================================ */
.main-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 20px 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.logo-section .logo {
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  text-decoration: none;
}

.logo-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon i {
  font-size: 28px;
}

.logo-text h1 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
}

.logo-text p {
  font-size: 0.9rem;
  margin: 0;
  opacity: 0.8;
}

.search-section {
  flex: 1;
  max-width: 400px;
}

.search-form {
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
}

.search-input {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.search-btn {
  background: var(--color-gold);
  border: none;
  padding: 12px 20px;
  color: white;
  cursor: pointer;
}

.search-btn:hover {
  background: #b8956a;
}

/* ============================================
   Main Navigation
   ============================================ */
.main-nav {
  background: var(--color-primary-dark);
  padding: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  display: block;
  color: rgba(255,255,255,0.9);
  padding: 15px 20px;
  transition: background 0.2s;
}

.nav-menu a:hover,
.nav-menu li.active a {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-menu i {
  margin-left: 8px;
}

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  list-style: none;
  padding: 10px 0;
  margin: 0;
}

.dropdown li a {
  color: var(--color-text);
  padding: 10px 20px;
}

.dropdown li a:hover {
  background: var(--bg-primary);
}

.has-dropdown:hover .dropdown {
  display: block;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a365d 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero-content h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.hero-content p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
}

.hero-search form {
  display: flex;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 18px 25px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.hero-search button {
  background: var(--color-gold);
  border: none;
  padding: 18px 30px;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-search button:hover {
  background: #b8956a;
}

/* ============================================
   Statistics Section
   ============================================ */
.statistics-section {
  background: white;
  padding: 50px 0;
  border-bottom: 1px solid var(--color-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.stat-card {
  text-align: center;
  padding: 30px 20px;
  background: var(--bg-primary);
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.stat-icon i {
  font-size: 28px;
  color: white;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 5px;
}

.stat-label {
  color: var(--color-text-light);
  font-size: 14px;
}

/* ============================================
   Categories Section
   ============================================ */
.categories-section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.section-header h2 i {
  margin-left: 10px;
}

.section-header p {
  color: var(--color-text-light);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card.featured {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
}

.category-card.featured .card-icon {
  background: rgba(255,255,255,0.2);
}

.category-card.featured .card-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.card-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  background: var(--bg-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon i {
  font-size: 24px;
  color: var(--color-primary);
}

.category-card.featured .card-icon i {
  color: white;
}

.card-content {
  flex: 1;
}

.card-content h3 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.card-content p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin: 0 0 10px;
  line-height: 1.4;
}

.category-card.featured .card-content p {
  color: rgba(255,255,255,0.8);
}

.card-count {
  display: inline-block;
  background: var(--bg-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--color-primary);
}

.card-arrow {
  color: var(--color-text-light);
}

.category-card.featured .card-arrow {
  color: rgba(255,255,255,0.7);
}

/* ============================================
   Latest Section
   ============================================ */
.latest-section {
  background: white;
  padding: 60px 0;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.latest-card {
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
}

.latest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-primary);
  color: white;
  padding: 15px 20px;
}

.latest-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.latest-header h3 i {
  margin-left: 10px;
}

.view-all {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

.view-all:hover {
  color: white;
}

.latest-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.latest-list li {
  border-bottom: 1px solid var(--color-border);
}

.latest-list li:last-child {
  border-bottom: none;
}

.latest-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: var(--color-text);
  transition: background 0.2s;
}

.latest-list a:hover {
  background: white;
}

.item-date,
.item-views {
  font-size: 0.85rem;
  color: var(--color-text-light);
  min-width: 100px;
}

.item-title {
  flex: 1;
  padding: 0 15px;
}

/* ============================================
   Quick Links Section
   ============================================ */
.quick-links-section {
  padding: 50px 0;
  background: var(--bg-primary);
}

.quick-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 12px 25px;
  border-radius: 50px;
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s;
}

.quick-link:hover {
  transform: translateY(-2px);
  color: var(--color-primary);
}

.quick-link i {
  color: var(--color-primary);
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
  background: #1a1a2e;
  color: white;
  padding: 50px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-section h4 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--color-gold);
}

.footer-section p {
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
  color: white;
}

.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact li {
  margin-bottom: 10px;
  color: rgba(255,255,255,0.7);
}

.footer-contact i {
  margin-left: 10px;
  color: var(--color-gold);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}

.social-links a:hover {
  background: var(--color-primary);
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  margin: 5px 0;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

.archive-notice {
  font-size: 0.8rem !important;
  color: rgba(255,255,255,0.4) !important;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
}

/* ============================================
   Page Wrapper for Legacy Pages
   ============================================ */
.page-wrapper {
  min-height: calc(100vh - 300px);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .search-section {
    max-width: 100%;
    width: 100%;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--color-primary-dark);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero-content h2 {
    font-size: 1.8rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .latest-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .top-bar-content {
    flex-direction: column;
    gap: 10px;
  }
}

/* ============================================
   LAW DOCUMENT PAGES (t*.html)
   Professional legal document layout
   ============================================ */
.law-document {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.law-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: 12px 12px 0 0;
  text-align: center;
}

.law-header h1 {
  font-size: 1.8rem;
  margin: 0 0 15px;
  font-weight: 700;
  line-height: 1.4;
}

.law-meta {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  opacity: 0.9;
}

.law-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.law-meta i {
  color: var(--color-gold);
}

.law-content {
  background: white;
  padding: 40px;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-card);
  line-height: 2;
  font-size: 1.1rem;
}

.law-content p {
  margin: 0 0 20px;
  text-align: justify;
}

.law-content h2,
.law-content h3,
.law-content h4 {
  color: var(--color-primary);
  margin: 30px 0 15px;
  font-weight: 700;
}

.law-content h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--color-gold);
  padding-bottom: 10px;
}

.law-content h3 {
  font-size: 1.3rem;
}

.law-content h4 {
  font-size: 1.15rem;
}

.law-content ul,
.law-content ol {
  margin: 20px 30px;
  padding: 0;
}

.law-content li {
  margin-bottom: 10px;
}

.law-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.law-content table th,
.law-content table td {
  border: 1px solid var(--color-border);
  padding: 12px 15px;
  text-align: right;
}

.law-content table th {
  background: var(--bg-primary);
  font-weight: 600;
  color: var(--color-primary);
}

.law-content table tr:nth-child(even) {
  background: #fafafa;
}

.law-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

.law-content a:hover {
  color: var(--color-primary-dark);
}

/* Additional content sections */
.law-supplement {
  margin-top: 30px;
  border-top: 3px solid var(--color-border);
  padding-top: 30px;
  border-radius: 0;
}

/* ============================================
   CATEGORY PAGES (f*.html)
   Grid layout for law listings
   ============================================ */
.category-page {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.category-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 30px;
}

.category-header h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
}

.category-header p {
  margin: 15px 0 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

.laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.law-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  border-right: 4px solid var(--color-primary);
}

.law-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-right-color: var(--color-gold);
}

.law-card-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.law-card-icon i {
  font-size: 22px;
  color: white;
}

.law-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
}

.law-card:hover h3 {
  color: var(--color-primary);
}

.law-card.unavailable {
  opacity: 0.6;
  cursor: not-allowed;
  border-right-color: #999;
}

.law-card.unavailable:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.unavailable-badge {
  display: inline-block;
  background: #999;
  color: white;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 8px;
}

.no-content {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* ============================================
   Hide remaining forum elements
   ============================================ */
.tborder,
.tcat,
.thead,
.tfoot,
.alt1,
.alt2,
.vbmenu_control,
.vbmenu_popup,
.navbar,
#posts table.tborder,
.pagenav,
.bigusername,
form[action*="login"],
form[action*="register"],
form[action*="newreply"],
table[id^="post"],
div[id^="edit"],
div[id^="postmenu"],
a[href*="member.php"],
a[href*="newreply.php"],
a[href*="private.php"],
a[href*="register.php"],
a[href*="login.php"],
img[src*="buttons/"],
img[src*="statusicon/"] {
  display: none !important;
}

/* But show law content divs */
div[id^="post_message_"] {
  display: block !important;
}

/* ============================================
   Responsive for law pages
   ============================================ */
@media (max-width: 768px) {
  .law-document {
    margin: 20px auto;
  }

  .law-header {
    padding: 25px 20px;
  }

  .law-header h1 {
    font-size: 1.4rem;
  }

  .law-content {
    padding: 25px 20px;
    font-size: 1rem;
    line-height: 1.8;
  }

  .category-header {
    padding: 25px 20px;
  }

  .category-header h1 {
    font-size: 1.5rem;
  }

  .laws-grid {
    grid-template-columns: 1fr;
  }

  .law-card {
    padding: 20px;
  }
}
