/* CTX-Crypto — Responsive Breakpoints */

/* Large tablets / small desktops */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 8px; }
  .hide-mobile { display: none !important; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .hamburger { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); z-index: 99;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a {
    padding: 14px 24px; width: 100%;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }
  .nav-links a::after { display: none; }
  .nav-links a:hover { background: var(--bg-card-hover); }
  /* Mobile dropdown */
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle {
    padding: 14px 24px !important; width: 100%;
    border-bottom: 1px solid var(--border); font-size: 1rem;
    justify-content: space-between;
  }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.is-open .nav-dropdown-menu { display: flex; }
  .nav-dropdown-menu {
    position: static; transform: none; box-shadow: none;
    border: none; border-radius: 0;
    flex-direction: column; min-width: 0; padding: 0;
    background: var(--bg-card-hover);
  }
  .nav-dropdown-menu::before { display: none; }
  .nav-dropdown-menu a {
    padding: 12px 24px 12px 44px; font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
  }
}

/* Phones */
@media (max-width: 600px) {
  :root { --gap: 12px; --gap-lg: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav { height: 56px; }
  .nav-links { top: 56px; }
  .logo { font-size: 1.2rem; }
  h1 { font-size: 1.4rem; }
  .widget-value { font-size: 1.4rem; }
  .btn-lg { padding: 12px 20px; font-size: 0.9rem; }
  .table { font-size: 0.8rem; }
  .table th, .table td { padding: 8px; }
  .container { padding: 0 12px; }
  .lang-switcher select { padding: 4px 6px; font-size: 0.75rem; min-width: 44px; }
  .nav-actions { gap: 6px; flex-wrap: nowrap; }
  .theme-toggle { width: 36px; height: 20px; flex-shrink: 0; }
  .theme-toggle::after { width: 14px; height: 14px; }
  [data-theme="dark"] .theme-toggle::after { transform: translateX(16px); }
}

/* Small phones */
@media (max-width: 380px) {
  .logo { font-size: 1.1rem; }
  h1 { font-size: 1.2rem; }
  .widget { padding: var(--gap); }
  .widget-value { font-size: 1.2rem; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .nav { height: 48px; }
  .nav-links { top: 48px; }
  .nav-links a { padding: 10px 24px; }
}

/* Tool Cards */
.tool-card { text-decoration: none; }
.tool-card p { color: var(--text-secondary); }

/* Smooth scrollbar */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(var(--gap-lg) + env(safe-area-inset-bottom)); }
  .header { padding-top: env(safe-area-inset-top); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Print */
@media print {
  .header, .footer, .cta-banner, .theme-toggle, .lang-switcher,
  .hamburger { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
