:root {
  --primary: #002b5c;
  --secondary: #0077b6;
  --accent: #00b4d8;
  --light: #f8f9fa;
  --dark: #343a40;
  --radius: 10px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--light);
  color: var(--dark);
  transition: background 0.3s ease, color 0.3s ease;
}

#content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.2rem;
}

.header-banner {
  display: block;
  width: 100%;
  height: auto;
}

header {
      grid-column: 1 / -1;
      background: var(--primary);
      color: white;
      text-align: center;
      font-size: 2rem;
      /*padding: 1rem;*/
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      position: relative;
}

#themeToggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}
/*#themeToggle:hover {
  background: var(--accent);
}*/

#subhead {
  grid-column: 1 / -1;
  background: var(--secondary);
  color: white;
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
}

 #subheadlogin {
      grid-column: 1 / -1;
      background: var(--secondary);
      color: white;
      text-align: center;
      font-size: 1.2rem;
      padding: 0.5rem;
      border-radius: var(--radius);
      margin-bottom: 0.5rem;
      box-shadow: var(--shadow);
    }

.main-menu {
  display: flex;
  gap: 1rem;
}

.dropdown {
  position: relative;
}

.dropbtn {
  background: var(--secondary);
  color: white;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.3s ease;
  text-decoration: none;
}

.dropbtn:hover {
  background: var(--accent);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--secondary);
  min-width: 200px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  z-index: 1000;
  flex-direction: column;
}

.dropdown-content a {
  color: var(--light);
  padding: 0.5rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.dropdown-content a:hover {
  background: var(--primary);
}

.dropdown:hover .dropdown-content {
  display: block;
}

footer {
  grid-column: 1 / -1;
  background: var(--secondary);
  color: white;
  text-align: center;
  padding: 0.8rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

footer a {
  color: white;
  margin: 0 0.5rem;
  text-decoration: none;
  font-weight: 500;
}
footer a:hover {
  text-decoration: underline;
}

.card {
  background: white;
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: background 0.3s ease, color 0.3s ease;
}

.toc h1 {
  font-size: 1.1rem;
  margin-top: 0;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3rem;
}

.toc a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.toc a:hover {
  color: var(--accent);
}

a.btn2 {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--secondary);
  color: white !important;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.3s ease;
}
a.btn2:hover {
  background: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Dark mode */
body.dark {
  background: #121212;
  color: #e0e0e0;
}
body.dark .card {
  background: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
body.dark header {
  background: #001f3f;
}

body.dark #subhead, body.dark footer {
  background: #005f86;
}
body.dark .dropbtn {
  background: #005f86;
}
body.dark .dropbtn:hover {
  background: #00b4d8;
}
body.dark .dropdown-content {
  background: #1e1e1e;
}
body.dark .dropdown-content a {
  color: #e0e0e0;
}
body.dark .dropdown-content a:hover {
  background: #2c2c2c;
}

/* ==========================
   INDEX PAGE STYLES
   ========================== */

/* پیام Session Expired */
.session-expired {
  color: red;
  text-align: center;
  margin: 1rem 0;
  font-weight: bold;
}

/* کانتینر لاگین */
.container {
  max-width: 350px;
  margin: 0 auto;
  text-align: center;
}

.container h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.container input,
.container button {
  width: 100%;
  padding: 0.6rem;
  margin: 0.5rem 0;
  border-radius: var(--radius);
  font-size: 1rem;
  box-sizing: border-box;
}

.container input {
  border: 1px solid #ccc;
}

.container input:focus {
  border-color: var(--secondary);
  outline: none;
  box-shadow: 0 0 4px rgba(0, 119, 182, 0.4);
}

.container button {
  border: none;
  background: var(--secondary);
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

.container button:hover {
  background: var(--accent);
}

/* استایل لاگین‌باکس */
.login-box {
  max-width: 320px;
  margin: auto;
  text-align: center;
}

.login-box h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

/* گروه ورودی‌ها */
.input-group {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  background: #f1f1f1;
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.input-group i {
  margin-right: 0.5rem;
  color: var(--secondary);
}

.input-group input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  outline: none;
}

/* دکمه‌ها */
.btn-login,
.btn-register {
  width: 100%;
  padding: 0.6rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-login {
  background: var(--secondary);
  color: white;
}

.btn-login:hover {
  background: var(--accent);
}

.btn-register {
  background: var(--primary);
  color: white;
}

.btn-register:hover {
  background: var(--accent);
}

/* پیام خطا */
.message {
  margin: 0.8rem 0;
  padding: 0.6rem;
  border-radius: var(--radius);
  font-weight: 500;
  background: #ffe5e5;
  color: #d9534f;
}

/* متن Sign up */
.signup-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--dark);
}

.signup-text a {
  color: var(--secondary);
  font-weight: bold;
  text-decoration: none;
}

.signup-text a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* عنوان‌های سمت راست */
#right h3 {
  color: var(--primary);
  margin: 0.3rem 0;
  font-size: 1rem;
  text-align: center;
  transition: color 0.3s ease;
}


/* Responsive rules */
@media (max-width: 1024px) {
  #content { grid-template-columns: 1fr 1fr; }
  #right { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  #content { grid-template-columns: 1fr !important; }
  #left, #center, #right { grid-column: 1 / -1 !important; }
  .main-menu { flex-direction: column; }
}
