/* ============================================================
   PHP4you - Modern Revamp Stylesheet
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --accent:        #FF9801;
  --accent-light:  #FFF3E0;
  --accent-dark:   #E67E00;
  --bg:            #F8F9FA;
  --card-bg:       #FFFFFF;
  --text:          #1A1A2E;
  --muted:         #6C757D;
  --border:        #E2E8F0;
  --footer-bg:     #1A1A2E;
  --footer-text:   #CBD5E0;
  --shadow:        0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.05);
  --radius:        8px;
  --radius-sm:     4px;
  --sidebar-left:  220px;
  --sidebar-right: 180px;
  --max-width:     1100px;
  --gap:           16px;
}

/* --- Reset / Normalize --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
a { color: var(--accent-dark); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* --- Site Wrapper --- */
.site-wrapper {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--card-bg);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--accent); }
.logo:hover .logo-text { color: var(--accent); text-decoration: none; }

/* Nav Bar */
.nav-bar {
  background: var(--accent);
}
.nav-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 0;
  align-items: center;
}
.nav-bar a {
  display: inline-block;
  padding: 10px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: background 0.15s;
  text-transform: uppercase;
}
.nav-bar a:hover {
  background: rgba(0,0,0,0.12);
  color: #fff;
  text-decoration: none;
}
.nav-bar a.active {
  background: rgba(0,0,0,0.18);
}

/* ============================================================
   PAGE BODY LAYOUT
   ============================================================ */
.page-body {
  flex: 1;
  padding: 20px 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.layout {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}
.sidebar-left  { width: var(--sidebar-left);  flex-shrink: 0; }
.main-content  { flex: 1; min-width: 0; }
.sidebar-right { width: var(--sidebar-right); flex-shrink: 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  overflow: hidden;
  border: 1px solid var(--border);
}
.card-header {
  background: var(--accent-light);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-dark);
  border-bottom: 1px solid #FFE0B2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header a {
  color: var(--accent-dark);
  font-weight: 700;
}
.card-header a:hover { color: var(--accent); }
.card-body { padding: 12px; }
.card-footer {
  background: #F5F5F5;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  text-align: right;
}
.card-footer a { color: var(--accent-dark); font-weight: 600; }
.card-footer a:hover { color: var(--accent); }

/* Sidebar link lists */
.sidebar-links { display: flex; flex-direction: column; gap: 4px; }
.sidebar-links a {
  font-size: 0.8rem;
  color: var(--text);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--accent); }

/* ============================================================
   FORMS (sidebar + standalone)
   ============================================================ */
.form-group { margin-bottom: 8px; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-control {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,152,1,0.15);
}
.radio-group { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.radio-group label { font-size: 0.78rem; color: var(--text); text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 400; }
.radio-group input[type="radio"] { accent-color: var(--accent); }

/* Standalone form (register, contact) */
.form-page { max-width: 560px; }
.form-page .form-group { margin-bottom: 14px; }
.form-page .form-control { padding: 9px 12px; font-size: 0.95rem; }
.form-page label { font-size: 0.85rem; margin-bottom: 5px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.required-note { font-size: 0.8rem; color: var(--muted); margin-bottom: 16px; }
.required-note strong { color: var(--accent-dark); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  letter-spacing: 0.2px;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,152,1,0.3);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 4px 12px rgba(255,152,1,0.4); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 4px 12px; font-size: 0.78rem; }
.btn-full { width: 100%; }
.btn-group { display: flex; gap: 8px; margin-top: 12px; }

/* Sidebar button */
.sidebar-btn { width: 100%; margin-top: 6px; }
.sidebar-links-text {
  font-size: 0.78rem;
  margin-top: 6px;
  text-align: center;
  color: var(--muted);
}
.sidebar-links-text a { color: var(--accent-dark); }

/* ============================================================
   PAGE TITLE
   ============================================================ */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
  letter-spacing: -0.3px;
}

/* ============================================================
   NEWS ITEMS (homepage + news page)
   ============================================================ */
.news-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.news-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.news-item-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.news-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.news-item-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 2px;
}
.news-item-meta span { font-weight: 600; color: var(--accent-dark); }
.news-item-body {
  padding: 10px 16px 12px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}
.news-item-body p { margin-bottom: 6px; }
.news-item-body a { color: var(--accent-dark); font-weight: 600; }
.news-item-body a:hover { color: var(--accent); }
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 6px;
}
.read-more:hover { color: var(--accent); }

/* ============================================================
   FORUMS
   ============================================================ */
.forum-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.forum-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #FFE0B2; }
.forum-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.forum-info { flex: 1; min-width: 0; }
.forum-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 3px;
}
.forum-name a { color: var(--text); }
.forum-name a:hover { color: var(--accent); text-decoration: none; }
.forum-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ============================================================
   TABLES (articles, scripts listing)
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.data-table thead tr {
  background: var(--accent-light);
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-dark);
  border-bottom: 2px solid #FFE0B2;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFAFA; }
.data-table a { color: var(--accent-dark); font-weight: 600; }
.data-table a:hover { color: var(--accent); }
.rating { color: var(--accent); letter-spacing: -1px; font-size: 0.9rem; }

/* Article categories */
.cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--accent-light);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  border: 1px solid #FFE0B2;
  transition: background 0.15s;
}
.cat-tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.cat-count {
  background: rgba(0,0,0,0.1);
  border-radius: 50px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
}
.cat-tag:hover .cat-count { background: rgba(255,255,255,0.25); }

/* Script grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.script-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.script-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: #FFE0B2; transform: translateY(-2px); }
.script-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.script-card a { font-size: 0.82rem; font-weight: 600; color: var(--text); text-align: center; line-height: 1.4; }
.script-card a:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   SEARCH FORM (articles page)
   ============================================================ */
.search-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.search-bar .form-group { margin-bottom: 0; }
.search-bar select { min-width: 160px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.faq-question {
  padding: 12px 16px;
  font-weight: 700;
  background: var(--accent-light);
  border-bottom: 1px solid #FFE0B2;
  color: var(--accent-dark);
  font-size: 0.95rem;
}
.faq-answer {
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}
.faq-answer a { color: var(--accent-dark); font-weight: 600; }
.faq-answer a:hover { color: var(--accent); }
.faq-answer code {
  font-family: monospace;
  background: #F0F4F8;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ============================================================
   DISCLAIMER / CONTACT / SIMPLE PAGES
   ============================================================ */
.prose {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  font-size: 0.95rem;
  line-height: 1.8;
}
.prose p { margin-bottom: 14px; }
.prose a { color: var(--accent-dark); font-weight: 600; }
.prose a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 20px 16px;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.footer-copy { color: #A0AEC0; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--footer-text); transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-sep { color: #4A5568; }

/* Section intro text */
.section-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Table action row */
.table-action {
  margin-top: 12px;
  text-align: right;
}

/* ============================================================
   MEDIA QUERIES
   ============================================================ */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar-left, .sidebar-right { width: 100%; }
  .layout .sidebar-right { order: 3; }
}
@media (max-width: 600px) {
  .nav-bar-inner { flex-wrap: wrap; }
  .nav-bar a { padding: 8px 10px; font-size: 0.78rem; }
  .header-inner { flex-wrap: wrap; }
  .scripts-grid { grid-template-columns: repeat(2, 1fr); }
  .news-item-header { flex-direction: column; }
  .form-row { flex-direction: column; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .search-bar { flex-direction: column; align-items: stretch; }
}
