:root {
  --bg-color: #050505;
  --card-bg: #111111;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --accent: #008eff;
  --accent-hover: #0077d6;
  --accent-secondary: #00c3ff;
  --error: #ff4d4d;
  --success: #00cc88;

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 142, 255, 0.15);

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-marquee: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

::-webkit-scrollbar {
  display: none;
}

p {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  margin: 0;
  padding: 0;
  padding-top: 71px;
  line-height: 1.6;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  padding: 15px 0;
  background: transparent;
  position: fixed;
  top: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 100;
  border-bottom: none;
}

header::before {
  content: "";
  position: absolute;
  inset: 0 0 -60px 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.6) 45%, rgba(5, 5, 5, 0) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
}

header.scrolled::before {
  opacity: 1;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  display: block;
  transition: opacity 0.3s ease;
  height: 40px;
}

.logo:hover img {
  opacity: 0.8;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  margin-right: -20px;
  color: var(--text-primary);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
  height: 40px;
  box-sizing: border-box;
}

.btn-icon-only {
  padding: 0;
  width: 40px;
  height: 40px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 5px 15px rgba(0, 142, 255, 0.2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-secondary {
  background: #222;
  color: #fff;
}

.btn-secondary:hover {
  background: #333;
  color: #fff;
}

.btn-danger {
  background: var(--error);
  color: #fff;
  border: 1px solid var(--error);
}

.btn-danger:hover {
  background: #e04444;
  border-color: #e04444;
  box-shadow: 0 5px 15px rgba(255, 77, 77, 0.2);
  color: #fff;
}

.btn-logout {
  padding: 0 !important;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-color: var(--glass-border);
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(255, 77, 77, 0.1) !important;
  border-color: var(--error) !important;
  color: var(--error) !important;
  box-shadow: 0 5px 15px rgba(255, 77, 77, 0.15);
}

.btn-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-dashboard svg {
  margin-right: 0 !important;
}

.form-box {
  max-width: 400px;
  margin: 60px auto;
  padding: 40px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: grid;
  grid-auto-flow: column;
  width: fit-content;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text-primary);
  box-sizing: border-box;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(255, 77, 77, 0.1);
  color: var(--error);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--error);
}

.alert-success {
  background: rgba(0, 204, 136, 0.1);
  color: var(--success);
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--success);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  margin: 10% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 15px;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.pdf-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
}

.pdf-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pdf-header {
  background: #111;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.pdf-close {
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.pdf-close:hover {
  color: var(--error);
}

.pdf-viewer-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.pdf-canvas-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

#pdfCanvas {
  max-width: 100%;
}

.pdf-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition:
    background 0.2s,
    transform 0.2s;
}

.pdf-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.pdf-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.pdf-nav-btn.prev {
  left: 30px;
}
.pdf-nav-btn.next {
  right: 30px;
}

.pdf-controls {
  background: #111;
  padding: 15px 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 1px solid #333;
}

.pdf-zoom-btn {
  background: #222;
  border: 1px solid #333;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.pdf-zoom-btn:hover {
  background: #333;
}

.pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  display: none;
}

footer {
  border: none;
  padding: 30px 0;
  background-color: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-social-link {
  display: flex;
  align-items: center;
  gap: 5px;
}

.copyright {
  opacity: 0.6;
  font-size: 0.85rem;
}

.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}

.animate-fade-in {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 968px) {
  .mobile-menu-btn {
    display: flex;
    position: static;
    margin: 0;
    z-index: 101;
  }

  .header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    padding: 80px 24px;
    box-sizing: border-box;
    background: rgba(5, 5, 5, 0.55);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
      opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 320ms;
  }

  .nav-links::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 50% 0%, rgba(0, 142, 255, 0.12), transparent 60%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.55));
    pointer-events: none;
    z-index: -1;
  }

  body.menu-open .nav-links {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
    transition:
      opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0s linear 0s;
  }

  .nav-link {
    font-size: 1.5rem;
  }

  .auth-buttons {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: none;
  }

  .auth-buttons .btn {
    width: auto;
    height: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  footer {
    padding: 28px 0 48px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 15px !important;
  }

  .footer-links {
    flex-direction: row;
    gap: 15px;
    justify-content: center;
  }

  .footer-logo {
    align-items: center !important;
  }
}

@media (max-width: 480px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .footer-links {
    flex-direction: column;
    gap: 15px;
    justify-content: center;
  }
}

@media (max-width: 500px) {
  header .logo img {
    content: url("/images/logo-icon-white.png");
  }
}

.mobile-logo-link {
  height: 36px;
}

.mr-2 {
  margin-right: 8px;
}

.hidden {
  display: none !important;
}

.version-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #555;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
