*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0c;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --accent: #6366f1;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 50% -20%, #1e1e2e 0%, transparent 50%);
}

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

body.light-theme {
  --bg: #f9fafb;
  --glass: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.07);
  --card: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-color: #111827;
  --accent: #2563eb;
  background-image: none;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  /*justify-content: center;*/
}

.app-header {
  width: 100%;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-sizing: border-box;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
}

body.light-theme .app-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

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

.app-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #5ab9ff);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.app-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none !important;
}

.header-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  white-space: nowrap;
  flex-shrink: 1;
}

.nav-link,
.nav-link:link,
.nav-link:visited {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
}

body.dark-theme .app-header {
  background: linear-gradient(180deg, #0b1220, #050b14);
}

.dark-theme .nav-link {
  color: #e5e7eb;
}

.nav-link:hover {
  color: #2563eb;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #111827;
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--text-primary);
  transition: width 0.3s;
}

.nav-link.active::after {
  width: 100%;
}

.dark-theme .nav-link.active::after {
  background: #f8fafc;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  background: var(--glass);
  color: var(--text-primary);
}

.theme-toggle:hover {
  color: var(--accent);
}

/* hamburger hidden on desktop */

.hamburger {
  display: none;
  font-size: 22px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 600px) {
  .app-logo {
    transform: scale(0.9);
  }

  .app-name {
    font-size: 1.1rem;
    & a {
      text-decoration: none !important;
    }
  }
}

/* Hero input */
.hero-input-card {
  width: 100%;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  padding: 2rem;
}

.hero-input-card h1 {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.alert-error {
  text-align: center;
  color: #ff6b6b;
  margin-top: 8px;
  font-size: 14px;
}

.input-wrapper {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
}

.input-wrapper input {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.btn-primary {
  padding: 0.8rem 2rem;
  border-radius: 1.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  font-size: larger;
}

.btn-primary:hover {
  background: #4f46e5;
}

.options-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.result-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.1), rgba(0, 0, 0, 0));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 2rem;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.result-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.short-url {
  max-width: 100%;
}

.qr-image {
  width: 80px;
  height: 80px;
  border-radius: 1rem;
  background: #fff;
  padding: 0.5rem;
}

.ready-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.short-url a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.download-link {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.download-link:hover {
  color: var(--accent);
}

.recent-tray {
  width: 100%;
  margin-top: 2rem;
  overflow: visible;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  padding: 0 0.5rem;
  align-items: center;
}

.scroll-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.4rem 16px 1rem;
  scroll-padding-right: 16px;
  box-sizing: border-box;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

.recent-item {
  width: 260px;
  flex: 0 0 auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}

.recent-item:last-child {
  margin-right: 16px;
}

.short-code {
  color: var(--accent);
  font-weight: bold;
}

.hero {
  text-align: center;
  margin: 40px 0;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
}

/* ===============================
   MODERN GLASS RECENT TABLE
================================= */
.recent-page-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.recent-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===============================
   TABLE BASE
================================= */

.recent-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  table-layout: fixed;
  min-width: 720px;
}

.recent-table thead {
  background: var(--glass);
}

.recent-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.recent-table td {
  padding: 14px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
  transition: 0.25s ease;
  white-space: nowrap;
}

.recent-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ===============================
   COLUMN WIDTH CONTROL
================================= */

.recent-table th:nth-child(1),
.recent-table td:nth-child(1) {
  width: 45px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

.recent-table th:nth-child(2),
.recent-table td:nth-child(2) {
  width: 170px;
}

.recent-table th:nth-child(3),
.recent-table td:nth-child(3) {
  width: 45%;
  min-width: 0;
}

.recent-table th:nth-child(4),
.recent-table td:nth-child(4) {
  width: 170px;
}

.recent-table th:nth-child(5),
.recent-table td:nth-child(5) {
  width: 80px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-2);
}

.recent-table th:nth-child(6),
.recent-table td:nth-child(6) {
  width: 120px;
}

/* ===============================
   LINKS
================================= */

.short-code a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.short-code a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.original-url {
  word-break: break-all;
}

.original-url a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

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

.created-time {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ===============================
   ACTION BUTTONS
================================= */

.action-col {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: 0.2s ease;
}

.open-btn {
  background: #3b82f6;
  color: #fff;
}

.delete-btn {
  background: #ef4444;
  color: #fff;
}

/* ===============================
   DARK MODE
================================= */

.dark-theme .recent-table th,
.dark-theme .recent-table td {
  color: #e5e7eb;
  border-bottom: 1px solid var(--glass-border);
}

/* Footer */
footer.big-footer {
  background: var(--bg);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 1rem 2rem;
  margin-top: auto;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.footer-meta {
  display: flex;
  gap: 1rem;
}

.footer-meta a {
  color: inherit;
  text-decoration: none;
}

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

/* Dark mode footer adjustments */
body.dark-theme footer.big-footer {
  background: #020617 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-theme .footer-col h4 {
  color: #f3f4f6;
}

body.dark-theme .footer-col p,
body.dark-theme .footer-col ul li a,
body.dark-theme .footer-bottom {
  color: #cbd5e1;
}

body.dark-theme .footer-col ul li a:hover,
body.dark-theme .footer-bottom a {
  color: #a5f3fc;
}

.recent-tray .recent-item .original-url {
  max-width: 350px;
  min-width: 0;
}

.recent-tray .recent-item .original-url,
.recent-tray .recent-item .original-url a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.recent-tray .recent-item {
  min-width: 0;
  max-width: 100%;
}

/* ===============================
   VIEW HISTORY COLOR BY THEME
================================= */

body.dark-theme .history-link {
  color: #ffffff;
}

body.light-theme .history-link {
  color: #000000;
}

.history-link {
  text-decoration: line;
  font-weight: 600;
  transition: 0.2s ease;
}

.history-link:hover {
  opacity: 0.7;
}

.contact-info {
  max-width: 600px;
  margin: 0 auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 2rem;
  list-style-type: none;

  & li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
  }
}

/*mobile responsive section */

/*tablet version */
@media (max-width: 1024px) {
  .recent-page-container {
    padding: 0 18px;
  }
}

/* Mobile (MAIN BREAKPOINT — 700px) */
@media (max-width: 700px) {
  /* header */
  .hamburger {
    display: block;
  }

  .header-nav {
    display: none;
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--glass-border);
  }

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

  /* layout */
  .main-layout {
    padding: 0.6rem;
  }

  .page {
    padding: 0 0.5rem;
  }

  /* FIX HERO */
  .hero {
    margin: 0 0 10px;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.2rem !important;
    line-height: 1.3;
    margin: 0;
  }

  .hero-input-card {
    padding: 1rem;
  }

  .hero-input-card h1 {
    font-size: 1.2rem;
  }

  /* input */
  .input-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }

  .input-wrapper input {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .btn-primary {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  /* result */
  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .result-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
  }

  .qr-image {
    width: 60px;
    height: 60px;
  }

  .short-url a {
    font-size: 1rem;
    word-break: break-all;
  }

  .result-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .btn-copy {
    flex: 1;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .download-link {
    font-size: 0.75rem;
  }

  /* recent */
  .recent-header {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
  }

  .recent-header h3 {
    font-size: 0.9rem;
  }

  .history-link {
    font-size: 0.8rem;
  }

  .recent-item {
    min-width: 180px;
  }

  .scroll-container {
    padding-top: 0.2rem;
  }

  /* footer */
  footer.big-footer {
    padding: 1.5rem 0.8rem 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/*Small mobile (optional)*/
@media (max-width: 480px) {
  .recent-page-container {
    padding: 0 8px;
  }
}

details summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

details[open] summary {
  color: #2563eb;
  /* Primary brand color */
}

.faq-answer {
  padding: 1rem;
  line-height: 1.6;
  color: #4b5563;
}
