/* =========================================================
   1000 WORDS
   responsive.css
========================================================= */


/* =========================================================
   TABLET / NOTEBOOK PEQUEÑO
========================================================= */

@media (max-width: 1150px) {

  :root {
    --sidebar-width: 230px;
  }

  .page-container {
    width: min(100% - 40px, 1050px);
  }

  .learning-hero {
    grid-template-columns: 1.4fr 0.6fr;

    padding: 42px;
  }

  .hero-content h2 {
    font-size: 2.6rem;
  }

  .progress-circle {
    width: 160px;
    height: 160px;
  }

  .progress-circle::before {
    width: 140px;
    height: 140px;
  }

  .stats-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .categories-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

  :root {
    --sidebar-width: 270px;
  }


  /* =======================================================
     SIDEBAR MOBILE
  ======================================================= */

  .sidebar {
    width: var(--sidebar-width);

    transform: translateX(-105%);

    box-shadow:
      20px 0 60px rgba(20, 22, 35, 0.15);

    transition:
      transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }


  /* =======================================================
     MOBILE HEADER
  ======================================================= */

  .mobile-header {
    position: sticky;
    top: 0;

    z-index: 400;

    display: flex;
    align-items: center;
    justify-content: space-between;

    height: 65px;

    padding: 0 20px;

    background:
      rgba(255, 255, 255, 0.92);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(15px);
  }

  .menu-button {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    color: var(--text);
    background: var(--surface-3);

    border-radius: 10px;

    font-size: 1.15rem;
  }

  .mobile-logo {
    display: flex;
    align-items: center;

    gap: 8px;
  }

  .mobile-logo > span {
    display: grid;
    place-items: center;

    width: 31px;
    height: 31px;

    color: #fff;

    background:
      linear-gradient(
        135deg,
        var(--primary),
        var(--primary-light)
      );

    border-radius: 9px;

    font-size: 0.82rem;
    font-weight: 900;
  }

  .mobile-logo strong {
    font-size: 0.82rem;
  }

  .mobile-avatar {
    width: 36px;
    height: 36px;
  }


  /* =======================================================
     CONTENT
  ======================================================= */

  .main-content {
    margin-left: 0;
  }

  .page-container {
    width: min(100% - 34px, 820px);

    padding-top: 35px;
  }


  /* =======================================================
     HOME
  ======================================================= */

  .welcome-header {
    margin-bottom: 24px;
  }

  .learning-hero {
    grid-template-columns: 1fr;

    gap: 35px;

    padding: 40px;

    text-align: center;
  }

  .hero-content h2,
  .hero-content p {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-progress {
    order: -1;
  }

  .progress-circle {
    width: 145px;
    height: 145px;
  }

  .progress-circle::before {
    width: 126px;
    height: 126px;
  }

  .progress-circle-inner strong {
    font-size: 2rem;
  }


  /* =======================================================
     DASHBOARD
  ======================================================= */

  .dashboard-grid {
    grid-template-columns: 1fr;
  }


  /* =======================================================
     PROGRESS
  ======================================================= */

  .progress-overview-card {
    grid-template-columns: 1fr;

    gap: 25px;
  }

  .progress-stats-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  /* =======================================================
     PROFILE
  ======================================================= */

  .profile-cover {
    height: 150px;
  }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {

  body {
    background: #f7f7fb;
  }


  /* =======================================================
     GLOBAL
  ======================================================= */

  .page-container {
    width: calc(100% - 28px);

    padding-top: 27px;
    padding-bottom: 60px;
  }

  .page-header {
    margin-bottom: 25px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 0.82rem;
  }

  .page-eyebrow,
  .section-eyebrow,
  .eyebrow {
    font-size: 0.66rem;
  }


  /* =======================================================
     MOBILE HEADER
  ======================================================= */

  .mobile-header {
    height: 60px;

    padding: 0 14px;
  }


  /* =======================================================
     ONBOARDING
  ======================================================= */

  .onboarding {
    align-items: flex-start;

    padding: 18px 14px;
  }

  .onboarding-card {
    width: 100%;

    margin: auto 0;

    padding: 23px 20px 27px;

    border-radius: 22px;
  }

  .onboarding-brand {
    margin-bottom: 25px;
  }

  .brand-icon {
    width: 39px;
    height: 39px;
  }

  .onboarding-content h1 {
    font-size: 2.5rem;
  }

  .onboarding-content > p {
    font-size: 0.84rem;
  }

  .avatar-setup {
    margin: 23px 0;
  }

  .avatar-preview {
    width: 68px;
    height: 68px;
  }


  /* =======================================================
     WELCOME
  ======================================================= */

  .welcome-header {
    align-items: flex-start;

    margin-bottom: 20px;
  }

  .welcome-header h1 {
    font-size: 2rem;
  }

  .welcome-header p {
    max-width: 250px;

    font-size: 0.78rem;
  }

  .today-badge {
    padding: 8px 10px;
  }

  .today-badge > span {
    font-size: 1rem;
  }

  .today-badge strong {
    font-size: 0.9rem;
  }


  /* =======================================================
     HERO
  ======================================================= */

  .learning-hero {
    min-height: 0;

    gap: 25px;

    padding: 30px 22px;

    border-radius: 22px;
  }

  .hero-badge {
    font-size: 0.64rem;
  }

  .hero-content h2 {
    font-size: 2.1rem;
  }

  .hero-content p {
    font-size: 0.8rem;
  }

  .hero-actions {
    flex-direction: column;

    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .progress-circle {
    width: 125px;
    height: 125px;
  }

  .progress-circle::before {
    width: 108px;
    height: 108px;
  }

  .progress-circle-inner strong {
    font-size: 1.7rem;
  }

  .progress-circle-inner small {
    font-size: 0.6rem;
  }


  /* =======================================================
     INFO
  ======================================================= */

  .info-banner {
    grid-template-columns: auto 1fr;

    margin-bottom: 30px;
  }

  .info-close {
    position: absolute;
    right: 18px;
  }

  .info-banner {
    position: relative;
  }

  .info-content {
    padding-right: 20px;
  }

  .info-content p {
    margin-top: 3px;

    font-size: 0.7rem;
  }


  /* =======================================================
     SECTION HEADER
  ======================================================= */

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 1.3rem;
  }

  .section-heading .text-link {
    font-size: 0.68rem;
  }


  /* =======================================================
     STATS
  ======================================================= */

  .stats-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 10px;
  }

  .stat-card {
    align-items: flex-start;
    flex-direction: column;

    gap: 9px;

    padding: 15px;
  }

  .stat-icon {
    width: 37px;
    height: 37px;

    border-radius: 10px;

    font-size: 0.95rem;
  }

  .stat-data > span {
    font-size: 0.62rem;
  }

  .stat-data strong {
    font-size: 1.4rem;
  }

  .stat-data small {
    font-size: 0.58rem;
  }


  /* =======================================================
     DASHBOARD CARDS
  ======================================================= */

  .dashboard-card {
    padding: 18px;

    border-radius: 18px;
  }

  .card-header {
    margin-bottom: 17px;
  }

  .card-header h3 {
    font-size: 1rem;
  }


  /* =======================================================
     CATEGORY PROGRESS
  ======================================================= */

  .category-progress-item {
    grid-template-columns: 75px 1fr 38px;
  }

  .category-progress-item strong {
    font-size: 0.67rem;
  }


  /* =======================================================
     CONTINUE CTA
  ======================================================= */

  .continue-card {
    align-items: flex-start;
    flex-direction: column;

    gap: 20px;

    padding: 22px;
  }

  .continue-card h2 {
    font-size: 1.2rem;
  }

  .continue-card .btn {
    width: 100%;
  }


  /* =======================================================
     CATEGORIES
  ======================================================= */

  .categories-grid {
    grid-template-columns: 1fr;

    gap: 12px;
  }

  .category-card {
    min-height: 210px;

    padding: 19px;

    border-radius: 18px;
  }

  .category-icon {
    width: 43px;
    height: 43px;

    margin-bottom: 18px;
  }

  .category-content h3 {
    font-size: 1.15rem;
  }


  /* =======================================================
     PROGRESS
  ======================================================= */

  .progress-overview-card {
    padding: 24px 20px;

    border-radius: 18px;
  }

  .progress-overview-info h2 {
    font-size: 1.6rem;
  }

  .progress-stats-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 9px;
  }

  .progress-stat-card {
    padding: 16px;
  }

  .progress-stat-card strong {
    font-size: 1.5rem;
  }

  .category-stat-row {
    grid-template-columns: 90px 1fr 35px;

    gap: 8px;
  }

  .category-stat-row strong {
    font-size: 0.67rem;
  }


  /* =======================================================
     PROFILE
  ======================================================= */

  .profile-cover {
    height: 120px;
  }

  .profile-card-content {
    padding: 0 20px 25px;
  }

  .profile-avatar-section {
    margin-top: -45px;
  }

  .profile-large-avatar {
    width: 90px;
    height: 90px;
  }

  .profile-main-info h2 {
    font-size: 1.4rem;
  }

  .profile-form {
    grid-template-columns: 1fr;

    margin-top: 24px;
  }

  .profile-form .btn {
    width: 100%;
  }


  /* =======================================================
     SETTINGS
  ======================================================= */

  .settings-card {
    position: relative;

    grid-template-columns: auto 1fr;

    align-items: flex-start;

    padding: 17px;
  }

  .settings-card > .btn,
  .settings-card > label.btn,
  .settings-card > .status-badge {
    grid-column: 1 / -1;

    width: 100%;
  }

  .settings-icon {
    width: 40px;
    height: 40px;
  }

  .settings-content h3 {
    font-size: 0.84rem;
  }

  .settings-content p {
    margin-top: 3px;

    font-size: 0.68rem;
  }


  /* =======================================================
     GAME
  ======================================================= */

  .game-container {
    width: calc(100% - 28px);

    padding-top: 15px;
  }

  .game-header {
    grid-template-columns: 40px 1fr 45px;

    gap: 10px;

    margin-bottom: 35px;
  }

  .game-close-button {
    width: 38px;
    height: 38px;
  }

  .game-progress-info {
    font-size: 0.62rem;
  }

  .game-score {
    font-size: 0.78rem;
  }

  .question-meta {
    margin-bottom: 12px;
  }

  .question-card {
    padding: 28px 17px;

    border-radius: 19px;
  }

  .question-instruction {
    font-size: 0.76rem;
  }

  .question-word {
    font-size: 3.3rem;
  }

  .question-example {
    font-size: 0.72rem;
  }

  .answer-options {
    grid-template-columns: 1fr;

    gap: 8px;
  }

  .answer-option {
    min-height: 56px;

    padding: 12px 14px;

    font-size: 0.8rem;
  }

  .answer-feedback {
    grid-template-columns: auto 1fr;

    padding: 12px;
  }

  .answer-feedback .btn {
    grid-column: 1 / -1;

    width: 100%;
  }


  /* =======================================================
     MODALS
  ======================================================= */

  .modal {
    align-items: flex-end;

    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 90vh;

    padding: 25px 18px;

    border-radius:
      24px 24px 0 0;

    animation: mobileModalIn 0.3s ease;
  }

  @keyframes mobileModalIn {

    from {
      opacity: 0;
      transform: translateY(100%);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }

  }

  .game-category-selector {
    grid-template-columns: 1fr;
  }

  .game-category-option {
    padding: 10px;
  }

  .result-score strong {
    font-size: 3.2rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }


  /* =======================================================
     CONFIRMATION
  ======================================================= */

  .confirmation-actions {
    flex-direction: column-reverse;
  }

  .confirmation-actions .btn {
    width: 100%;
  }


  /* =======================================================
     TOAST
  ======================================================= */

  .toast-container {
    right: 14px;
    bottom: 14px;

    width: calc(100% - 28px);
  }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 400px) {

  .page-container {
    width: calc(100% - 22px);
  }

  .mobile-header {
    padding: 0 11px;
  }

  .mobile-logo strong {
    display: none;
  }


  /* ONBOARDING */

  .onboarding {
    padding: 10px;
  }

  .onboarding-card {
    padding:
      20px 16px 24px;
  }

  .onboarding-content h1 {
    font-size: 2.15rem;
  }


  /* WELCOME */

  .welcome-header {
    gap: 10px;
  }

  .welcome-header h1 {
    font-size: 1.7rem;
  }

  .welcome-header p {
    max-width: 210px;
  }

  .today-badge {
    flex-direction: column;

    gap: 2px;

    text-align: center;
  }


  /* HERO */

  .learning-hero {
    padding:
      27px 17px;
  }

  .hero-content h2 {
    font-size: 1.85rem;
  }


  /* STATS */

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    padding: 13px;
  }


  /* PROGRESS */

  .progress-stats-grid {
    grid-template-columns: 1fr 1fr;
  }


  /* CATEGORY */

  .category-card {
    min-height: 195px;
  }


  /* GAME */

  .game-container {
    width: calc(100% - 20px);
  }

  .question-word {
    font-size: 2.8rem;
  }

  .question-type,
  .word-category-badge {
    font-size: 0.57rem;
  }

}


/* =========================================================
   LANDSCAPE PHONE
========================================================= */

@media (
  max-height: 600px
)
and
(
  orientation: landscape
) {

  .onboarding {
    position: relative;

    min-height: 100vh;
  }

  .onboarding-card {
    margin: 15px auto;
  }

  .game-header {
    margin-bottom: 20px;
  }

  .question-card {
    padding: 20px;
  }

  .question-word {
    font-size: 2.8rem;
  }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }

}


/* =========================================================
   PRINT
========================================================= */

@media print {

  .sidebar,
  .mobile-header,
  .sidebar-overlay,
  .btn,
  .toast-container,
  .modal {
    display: none !important;
  }

  .main-content {
    margin: 0;
  }

  body {
    background: #fff;
  }

  .page-container {
    width: 100%;
  }

}