
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&family=Montserrat:wght@600;700;800&display=swap');

/* ===== ROOT COLORS ===== */
:root {
  --primary-blue: #0a3d6d;
  --accent-blue: #0984e3;
  --accent-purple: #6c5ce7;
  --text-dark: #1f2937;
  --text-soft: #4b5563;
  --glass: rgba(255, 255, 255, 0.16);
  --card-bg: rgba(255, 255, 255, 0.96);

  --a1: #1a1aaf;
  --a2: #2d2db5;
  --a3: #4b3fcb;
  --a4: #6b35c9;
  --a5: #8b2fc4;

  --accent: #100c06;
  --accent2: #ffc355;
  --accent-glow: rgba(245, 166, 35, 0.35);

  --text: #ffffff;
  --text2: rgba(255, 255, 255, 0.72);
  --text3: rgba(255, 255, 255, 0.45);

  --card-bg-glass: rgba(255, 255, 255, 0.951);
  --card-border: rgba(255, 0, 0, 0.18);
  --nav-bg: rgba(26, 26, 175, 0.55);

  --blob1: rgba(255, 255, 255, 0.06);
  --blob2: rgba(255, 255, 255, 0.04);
}

/* ===== PAGE THEMES ===== */
[data-page="index"] {
  --a1: #1a1aaf;
  --a2: #2b2bb8;
  --a3: #4b3fcb;
  --a4: #6b35c9;
  --a5: #8b2fc4;
  --accent: #98c2f5;
  --accent2: #064c68;
  --accent-glow: rgba(245, 166, 35, 0.35);
}

[data-page="login"] {
  --a1: #0d3b7a;
  --a2: #1a5296;
  --a3: #1e6bb5;
  --a4: #2980d4;
  --a5: #3a9ee8;
  --accent: #34d399;
  --accent2: #6ee7b7;
  --accent-glow: rgba(52, 211, 153, 0.35);
  --nav-bg: rgba(13, 59, 122, 0.55);
}

[data-page="comment"] {
  --a1: #4a0a6b;
  --a2: #631589;
  --a3: #7c1fa6;
  --a4: #962dbf;
  --a5: #b03dd4;
  --accent: #f472b6;
  --accent2: #f9a8d4;
  --accent-glow: rgba(244, 114, 182, 0.35);
  --nav-bg: rgba(173, 81, 219, 0.55);
}

[data-page="profile"] {
  --a1: #1a3a6b;
  --a2: #1e4d8c;
  --a3: #2461b0;
  --a4: #4a7ecb;
  --a5: #6b9edf;
  --accent: #fbbf24;
  --accent2: #fcd34d;
  --accent-glow: rgba(251, 191, 36, 0.35);
  --nav-bg: rgba(26, 58, 107, 0.55);
}

[data-page="test"],
[data-page="tests"] {
  --a1: #0c3d6b;
  --a2: #0f5286;
  --a3: #1469a8;
  --a4: #1a82cc;
  --a5: #22a0e8;
  --accent: #22d3ee;
  --accent2: #67e8f9;
  --accent-glow: rgba(34, 211, 238, 0.35);
  --nav-bg: rgba(12, 61, 107, 0.55);
}

[data-page="result"] {
  --a1: #1a1aaf;
  --a2: #2d2db5;
  --a3: #4b3fcb;
  --a4: #6b35c9;
  --a5: #8b2fc4;
  --accent: #a78bfa;
  --accent2: #c4b5fd;
  --accent-glow: rgba(167, 139, 250, 0.35);
}

[data-page="tsag_awah"] {
  --a1: #1e1060;
  --a2: #2d1880;
  --a3: #3d24a0;
  --a4: #5535c0;
  --a5: #6b4ad4;
  --accent: #818cf8;
  --accent2: #a5b4fc;
  --accent-glow: rgba(129, 140, 248, 0.35);
  --nav-bg: rgba(30, 16, 96, 0.55);
}

[data-page="podcast"] {
  --a1: #1a0a3d;
  --a2: #2d1060;
  --a3: #461a8b;
  --a4: #6024b0;
  --a5: #7a30c8;
  --accent: #fb923c;
  --accent2: #fdba74;
  --accent-glow: rgba(251, 146, 60, 0.35);
  --nav-bg: rgba(26, 10, 61, 0.55);
}

[data-page="admin"],
[data-page="add_test"] {
  --a1: #1a0a2e;
  --a2: #2d1050;
  --a3: #3d1870;
  --a4: #5525a0;
  --a5: #6b35c0;
  --accent: #f87171;
  --accent2: #fca5a5;
  --accent-glow: rgba(248, 113, 113, 0.35);
  --nav-bg: rgba(26, 10, 46, 0.55);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== GLOBAL FONT FIX ===== */
body,
p,
span,
li,
label,
a,
button,
input,
textarea,
select,
td,
th,
small,
div {
  font-family: 'Noto Sans', sans-serif;
}

h1,
h2,
h3,
h4,
.logo,
.title,
.hero-title,
.score-display {
  font-family: 'Montserrat', 'Noto Sans', sans-serif;
}

/* ===== BODY ===== */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg,
      var(--a1) 0%,
      var(--a2) 25%,
      var(--a3) 55%,
      var(--a4) 78%,
      var(--a5) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ===== BLOB BACKGROUND ===== */
body::before {
  content: '';
  position: fixed;
  width: 65vw;
  height: 65vw;
  max-width: 700px;
  max-height: 700px;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 62% 38% 46% 54% / 42% 58% 42% 58%;
  top: -15%;
  right: -10%;
  pointer-events: none;
  z-index: 0;
  animation: blobA 9s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  width: 50vw;
  height: 50vw;
  max-width: 550px;
  max-height: 550px;
  background: rgba(235, 235, 237, 0.058);
  border-radius: 48% 52% 38% 62% / 55% 45% 62% 38%;
  bottom: -10%;
  left: -8%;
  pointer-events: none;
  z-index: 0;
  animation: blobB 9s ease-in-out infinite alternate;
}

@keyframes blobA {
  0% {
    border-radius: 62% 38% 46% 54% / 42% 58% 42% 58%;
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    border-radius: 38% 62% 58% 42% / 55% 45% 58% 42%;
    transform: translate(30px, 50px) rotate(8deg);
  }
}

@keyframes blobB {
  0% {
    border-radius: 48% 52% 38% 62% / 55% 45% 62% 38%;
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    border-radius: 60% 40% 52% 48% / 40% 60% 40% 60%;
    transform: translate(-20px, -30px) rotate(-6deg);
  }
}

/* ===== TOP BAR ===== */
.bar {
  background: rgba(0, 0, 0, 0.22);
  color: var(--text2);
  padding: 10px 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 30px;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  letter-spacing: 0.2px;
  flex-wrap: wrap;
  position: relative;
  z-index: 100;
}

.bar a {
  color: var(--text2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.bar a:hover {
  color: var(--text);
}

.bar img {
  height: 16px;
  width: auto;
  filter: brightness(0) invert(1) opacity(0.7);
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 50px;
}

.logo img {
  width: 45px;
  border-radius: 12px;
  filter: drop-shadow(0 2px 12px rgba(173, 51, 51, 0.3));
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
  font-size: 14px;
  transition: 0.3s ease;
  letter-spacing: 0.3px;
  position: relative;
  text-transform: uppercase;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: #fff;
  transform: translateY(-2px);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===== USER MENU ===== */
.user-icons {
  position: relative;
}

.user-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.user-btn img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.2s;
}

.user-btn img:hover {
  border-color: var(--accent);
}

#menu {
  position: absolute;
  right: 0;
  top: 48px;
  background: rgba(20, 15, 70, 0.96);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  list-style: none;
  padding: 10px 0;
  min-width: 170px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(24px);
}

#menu li {
  padding: 10px 20px;
  font-weight: 600;
  color: var(--text2);
}

#menu li:hover {
  background: rgba(255, 255, 255, 0.08);
}

#menu a {
  text-decoration: none;
  color: #fff;
  display: block;
}

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 72px;
  padding: 60px 50px 120px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== CARD / GLASS ===== */
.card,
.news-content,
.result-container,
.login-box,
.chat-box,
.profile-card,
.test-card,
.question-card,
.time-card,
.podcast-card,
.admin-card {
  background: rgb(255, 255, 255);
  border: 1px solid rgba(255, 255, 255, 0.01);
  border-radius: 20px;
  color: var(--text-dark);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* ===== NEWS CARD ===== */
.news-card {
  position: relative;
  width: 100%;
  height: 450px;
  transition: transform 0.3s ease;
  z-index: 1;
}

.news-card:hover {
  transform: translateY(-8px);
}

.news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.news-content {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  padding: 22px;
  border-radius: 24px;
  text-align: center;
}

.news-content h3 {
  margin: 0 0 10px;
  color: #343030;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.news-content p {
  font-size: 15px;
  line-height: 1.8;
  color: black;
  margin: 0;
  font-weight: 500;
}

.news-bottom {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
}

.news-bottom span {
  color: var(--text3);
}

.link {
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: blue;
  transition: 0.3s ease;
}

.link:hover {
  color: rgb(102, 102, 219);
}

/* ===== EXPAND TEXT ===== */
.more-text {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease-in-out;
  margin-top: 10px;
}

.news-card.active .more-text {
  max-height: 250px;
}

.news-card.active .link {
  color: #ea00ff;
}

/* ===== BUTTONS ===== */
button:not(.hamburger):not(.user-btn):not(.nav-toggle),
.btn,
.call-btn,
.back-btn,
input[type="submit"],
input[type="button"] {
  font-weight: 700;
  border-radius: 50px;
  transition: all 0.25s;
  cursor: pointer;
}

.btn-primary,
.call-btn,
.btn-consult,
button.primary,
.submit-btn {
  background: var(--accent);
  color: #1a1340;
  border: none;
  padding: 12px 32px;
  box-shadow: 0 6px 24px var(--accent-glow);
  font-size: 15px;
}

.btn-primary:hover,
.call-btn:hover,
.btn-consult:hover {
  background: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--accent-glow);
}

.btn-secondary,
.back-btn,
.btn-back {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.btn-secondary:hover,
.back-btn:hover {
  background: rgba(255, 255, 255, 0.20);
}

/* ===== INPUT ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ===== TEXT ===== */
h1,
h2,
h3,
h4 {
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

h1 {
  font-size: clamp(26px, 4vw, 48px);
}

h2 {
  font-size: clamp(22px, 3vw, 36px);
}

h3 {
  font-size: clamp(18px, 2.5vw, 26px);
}

p,
span,
li,
label {
  color: var(--text2);
}

a {
  color: var(--accent2);
  transition: color 0.2s;
}

a:hover {
  color: #fff;
}

/* ===== SCORE ===== */
.score-display {
  font-size: 64px;
  font-weight: 800;
  color: #fff;
}

.level-badge {
  border-radius: 99px;
  font-weight: 700;
}

/* ===== PAGE HEADER ===== */

.page-header h1 {
  color: #fff;
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text2);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #fff;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.loading,
.empty {
  color: var(--text2);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .navbar {
    position: relative;
    padding: 10px 16px;
  }

  .logo {
    order: 1;
    z-index: 2;
  }

  .hamburger {
    display: flex;
    order: 2;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
  }

  .user-icons {
    order: 3;
    z-index: 2;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 15, 80, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    z-index: 999;
    border-radius: 0 0 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 0;
  }

  .nav-links a {
    display: block;
    padding: 13px 24px;
    color: #fff;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .bar {
    padding: 8px 16px;
    gap: 8px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
  }

  .main-content {
    grid-template-columns: 1fr;
    padding: 80px 16px 90px;
    gap: 85px;
  }

  .news-card {
    height: 390px;
  }

  .news-content {
    width: 90%;
    padding: 18px;
  }

  .news-content h3 {
    font-size: 20px;
  }

  .news-content p {
    font-size: 14px;
  }

  .news-bottom {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .news-card {
    height: 350px;
  }

  .news-content h3 {
    font-size: 18px;
  }
}