@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-hover: #252525;
  --accent-primary: #3b82f6;
  --text-primary: #fff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

body.loading .content-wrapper,
body.loading .social-bar {
  opacity: 0;
  visibility: hidden;
}

body.loaded .content-wrapper,
body.loaded .social-bar {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease-in;
}

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease-out, visibility 0.6s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.loader-text::after {
  content: '';
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0% {
    content: '';
  }
  33% {
    content: '.';
  }
  66% {
    content: '..';
  }
  100% {
    content: '...';
  }
}

.social-bar {
  position: relative;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(20, 20, 20, 0.95);
}

.social-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  white-space: nowrap;
}

.social-bar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.social-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exchange-rate {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.exchange-rate:hover {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.exchange-rate:active {
  transform: translateY(0);
}

.currency-amount {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

#usd-rate {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.currency-label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

#usd-rate.loading {
  color: var(--text-muted);
}

#usd-rate.error {
  color: var(--text-primary);
}


.social-bar a {
  transition: transform 0.2s, opacity 0.2s;
  display: inline-block;
}

.social-bar a:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

.social-bar img {
  height: 22px;
  border-radius: 4px;
  display: block;
}

.content-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
}

.sb-right {
  width: clamp(250px, 20vw, 350px);
  background: var(--bg-secondary);
  padding: clamp(16px, 2vw, 24px);
  overflow-y: auto;
  height: 100%;
  border-right: 1px solid var(--border-color);
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
  flex-shrink: 0;
}

.sb-right::-webkit-scrollbar {
  width: 6px;
}

.sb-right::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

.clock {
  margin-bottom: clamp(20px, 3vw, 32px);
}

.time {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: -1px;
  display: none;
}

.date {
  font-size: clamp(11px, 1.2vw, 13px);
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

.calendar {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: clamp(12px, 2vw, 20px);
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(12px, 2vw, 20px);
}

.cal-month {
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 600;
}

.cal-nav {
  display: flex;
  gap: 8px;
}

.cal-nav button {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: clamp(4px, 0.5vw, 6px) clamp(8px, 1vw, 12px);
  font-size: clamp(14px, 1.5vw, 16px);
  transition: all 0.2s;
  font-weight: 600;
}

.cal-nav button:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-secondary);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-name {
  text-align: center;
  font-size: clamp(9px, 1vw, 11px);
  color: var(--text-muted);
  font-weight: 600;
  padding: clamp(4px, 0.8vw, 8px) 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(11px, 1.2vw, 13px);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.cal-day:hover {
  background: var(--bg-hover);
}

.cal-day.today {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 2px var(--bg-tertiary), 0 0 0 4px var(--accent-primary);
}

.cal-day.other-month {
  color: var(--text-muted);
  opacity: 0.4;
}

.lfc-img {
  margin-top: clamp(20px, 3vw, 32px);
  text-align: center;
}

.lfc-img img {
  width: 100%;
  max-width: clamp(150px, 15vw, 200px);
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s, opacity 0.2s;
  border-radius: 12px;
  opacity: 0.9;
}

.lfc-img img:hover {
  opacity: 1;
  transform: scale(1.02);
}

.lfc-img img:active {
  transform: scale(0.98);
}

.main {
  flex: 1;
  overflow-y: auto;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
  background: var(--bg-secondary);
}

.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 4px;
}

.sb {
  width: clamp(220px, 18vw, 300px);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: clamp(16px, 2vw, 24px);
  overflow-y: auto;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sb::-webkit-scrollbar {
  width: 6px;
}

.sb::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}

.sb h3 {
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  margin: clamp(16px, 2vw, 24px) 0 clamp(8px, 1vw, 12px);
  letter-spacing: 1.5px;
  padding-left: clamp(8px, 1vw, 12px);
}

.sb h3:first-child {
  margin-top: 0;
}

.sb button {
  width: 100%;
  padding: clamp(8px, 1vw, 10px) clamp(12px, 1.5vw, 16px);
  margin: 2px 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sb button:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
  transform: translateX(2px);
}

.sb button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.totp-container {
  background: var(--bg-tertiary);
  border: none;
  border-radius: 12px;
  padding: clamp(12px, 1.5vw, 16px);
  margin: clamp(8px, 1vw, 12px) 0;
}

.totp-codes-row {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
}

.totp-code {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: clamp(2px, 0.3vw, 3px);
  cursor: pointer;
  user-select: none;
  padding: clamp(10px, 1.2vw, 14px) clamp(8px, 1vw, 12px);
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--bg-hover);
  border-radius: 10px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#totp-1 {
  color: #ef4444;
}

#totp-2 {
  color: #3b82f6;
}

#totp-3 {
  color: #fff;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 12px;
  cursor: default;
  pointer-events: none;
  animation: slideIn 0.2s ease-out;
}

.cmd {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 90%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  z-index: 2000;
  overflow: hidden;
}

.cmd.show {
  display: block;
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cmd input {
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.cmd input::placeholder {
  color: var(--text-muted);
}

.md-selector {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.md-selector.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

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

.md-selector-dialog {
  width: 320px;
  max-width: 90%;
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.2s ease-out;
}

.md-selector-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.md-selector-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.md-selector-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.md-selector-content {
  padding: 16px 12px 12px;
}

.md-selector-btn {
  width: 100%;
  padding: 12px 16px;
  margin: 0 0 8px 0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-selector-btn:last-child {
  margin-bottom: 0;
}

.md-selector-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.md-selector-btn.active {
  background: rgba(59, 130, 246, 0.3);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.md-selector-btn-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.md-selector-btn-title {
  font-size: 14px;
  font-weight: 600;
}

.md-selector-btn-desc {
  font-size: 11px;
  opacity: 0.7;
}

.md {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 48px) clamp(20px, 3vw, 32px);
}

.md.centered h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin: 32px 0 16px;
  letter-spacing: -0.5px;
  text-align: center;
}

.md.centered h2 {
  font-size: 1.875em;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.md.centered h3 {
  font-size: 1.5em;
  font-weight: 600;
  margin: 24px 0 16px;
  text-align: center;
}

.md.centered h4 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 24px 0 16px;
  text-align: center;
}

.md.centered p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: center;
}

.md h1 {
  font-size: 2.5em;
  font-weight: 700;
  margin: 32px 0 16px;
  letter-spacing: -0.5px;
}

.md h2 {
  font-size: 1.875em;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.md h3 {
  font-size: 1.5em;
  font-weight: 600;
  margin: 24px 0 16px;
}

.md h4 {
  font-size: 1.25em;
  font-weight: 600;
  margin: 24px 0 16px;
}

.md p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.md a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.md a:hover {
  text-decoration: underline;
}

.md ul,
.md ol {
  padding-left: 2em;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.md li {
  margin-top: 8px;
}

.md blockquote {
  padding: 0 1em;
  color: var(--text-muted);
  border-left: 3px solid var(--accent-primary);
  margin-bottom: 16px;
}

.md code {
  padding: 3px 6px;
  font-size: 85%;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  color: var(--accent-primary);
  border: none;
  font-weight: 500;
}

.md pre {
  padding: 20px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg-tertiary);
  border-radius: 12px;
  margin: 0 0 16px;
  border: none;
  transition: background 0.2s;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}

.md pre:hover {
  background: var(--bg-hover);
}

.md pre code {
  display: inline;
  padding: 0;
  background: transparent;
  font-size: 100%;
  border: none;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-weight: 400;
}

.md table {
  border-spacing: 0;
  border-collapse: collapse;
  margin-bottom: 16px;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.md table th {
  font-weight: 600;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.md table td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.md table tr {
  background: var(--bg-secondary);
}

.md table tr:nth-child(2n) {
  background: var(--bg-tertiary);
}

.md hr {
  height: 1px;
  margin: 32px 0;
  background: var(--border-color);
  border: 0;
}

.md img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.md strong {
  font-weight: 600;
  color: var(--text-primary);
}

.ld {
  text-align: center;
  padding: 80px 32px;
  color: var(--text-muted);
  font-size: 16px;
}

.main-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  padding: clamp(32px, 5vw, 48px) clamp(20px, 3vw, 32px);
}

.main-image {
  max-width: 90%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

@media (max-width: 1200px) {
  .sb-right {
    width: clamp(200px, 18vw, 250px);
  }
  .sb {
    width: clamp(200px, 18vw, 250px);
  }
}

/* Thêm vào cuối file style.css - thay thế phần @media (max-width: 768px) */

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    background: var(--bg-secondary);
  }
  
  .social-bar {
    display: none;
  }
  
  .content-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    flex: 1;
  }
  
  .sb-right {
    display: none;
  }
  
  .main {
    display: none;
  }
  
  .sb {
    width: 100%;
    border-left: none;
    padding: 16px;
    display: flex;
    height: auto;
    min-height: 100vh;
    flex: 1;
  }
  
  .sb h3 {
    font-size: 13px;
    margin: 16px 0 8px;
  }
  
  .sb button {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .totp-container {
    padding: 12px;
    margin: 8px 0;
  }
  
  .totp-code {
    font-size: 18px;
    padding: 10px 8px;
    letter-spacing: 2px;
  }
  
  .cmd {
    width: 90%;
  }
  
  .cmd input {
    font-size: 14px;
    padding: 16px 20px;
  }
  
  .md-selector {
    width: 90%;
  }
  
  .md {
    padding: 32px 20px;
  }
  
  .social-bar-center {
    position: static;
    transform: none;
  }
}

/* Thêm vào cuối file style.css */

.main-image-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: clamp(20px, 3vw, 32px);
  gap: clamp(24px, 3vh, 48px);
}

.main-image {
  max-width: 90%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  object-fit: contain;
}

.google-search-container {
  width: 100%;
  max-width: 900px;
}

.google-search-form {
  position: relative;
  width: 100%;
}

.google-search-input {
  width: 100%;
  padding: 16px 56px 16px 20px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s ease;
}

.google-search-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-hover);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.google-search-input::placeholder {
  color: var(--text-muted);
}

.google-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.google-search-btn:hover {
  background: var(--bg-hover);
  transform: translateY(-50%) scale(1.05);
}

.google-search-btn:active {
  transform: translateY(-50%) ;
}

.search-btn-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.google-search-btn:hover .search-btn-icon {
  opacity: 1;
}

@media (max-width: 768px) {
  .main-image-container {
    gap: clamp(16px, 2vh, 24px);
  }
  
  .main-image {
    max-height: 50vh;
  }
  
  .google-search-container {
    max-width: 100%;
  }
  
  .google-search-input {
    padding: 14px 52px 14px 18px;
    font-size: 15px;
  }
  
  .google-search-btn {
    width: 36px;
    height: 36px;
  }
  
  .search-btn-icon {
    width: 16px;
    height: 16px;
  }
}