/* ============================================
   GLOBAL RESPONSIVE CSS — IndianCuteKid
   Included via header.php on every page
============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

input, select, textarea, button {
  font-size: 16px; /* prevents iOS zoom on focus */
  max-width: 100%;
}

/* --- Safe area for notched phones --- */
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --- Bottom nav spacing (all pages) --- */
body {
  padding-bottom: 80px !important;
}

/* --- Scrollbar for touch --- */
.container, .tab-content, .tasks {
  -webkit-overflow-scrolling: touch;
}

/* --- Responsive containers --- */
.container {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}

/* ============================================
   HEADER — Fixed top logo bar
============================================ */
.top-header {
  padding: 8px 0 !important;
  height: auto !important;
}

.top-header img {
  height: 55px !important;
  max-width: 200px !important;
}

/* ============================================
   BOTTOM NAV — floating.php
============================================ */
.bottom-nav {
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 0 !important;
  padding: 10px 0 !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  left: 0 !important;
  transform: none !important;
}

.nav-item {
  font-size: 11px !important;
}

.nav-item i {
  font-size: 18px !important;
}

/* ============================================
   LOGIN MODAL — floating.php / login.php
============================================ */
.modal-content {
  margin: 40px auto !important;
  width: 92% !important;
  max-width: 400px !important;
  padding: 20px !important;
}

.mobile-input {
  font-size: 16px !important; /* prevent zoom */
}

/* ============================================
   SIDEBAR — floating.php
============================================ */
.sidebar {
  width: 85% !important;
  max-width: 300px !important;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
============================================ */

/* --- Extra Small: phones < 360px --- */
@media (max-width: 359px) {
  body {
    font-size: 13px;
    padding-top: 55px !important;
  }

  .top-header img {
    height: 40px !important;
    max-width: 150px !important;
  }

  .nav-item {
    font-size: 10px !important;
  }

  .nav-item i {
    font-size: 16px !important;
  }

  .bottom-nav {
    padding: 8px 0 !important;
  }

  .modal-content {
    margin: 20px auto !important;
    padding: 16px !important;
  }

  .avatar {
    width: 90px !important;
    height: 90px !important;
  }

  h1, h2 {
    font-size: 20px !important;
  }

  .contest-card {
    margin: 10px 5px !important;
  }

  .profile-img {
    width: 100px !important;
    height: 100px !important;
  }

  .balance-wrap {
    flex-direction: column !important;
  }

  .buttons a {
    flex: 1 1 100% !important;
    font-size: 14px !important;
    padding: 10px !important;
  }

  .streak-box {
    padding: 10px !important;
  }

  .days {
    gap: 3px !important;
  }

  .day {
    padding: 5px 2px !important;
    font-size: 10px !important;
  }

  .task h4 {
    font-size: 12px !important;
  }

  .btn {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
}

/* --- Small phones: 360px – 480px --- */
@media (min-width: 360px) and (max-width: 480px) {
  body {
    font-size: 14px;
    padding-top: 60px !important;
  }

  .top-header img {
    height: 48px !important;
    max-width: 170px !important;
  }

  .modal-content {
    margin: 30px auto !important;
  }

  .contest-card {
    margin: 12px 8px !important;
    border-radius: 12px !important;
  }

  .profile-img {
    width: 120px !important;
    height: 120px !important;
  }

  .buttons a {
    flex: 1 1 100% !important;
  }
}

/* --- Regular phones: 481px – 640px --- */
@media (min-width: 481px) and (max-width: 640px) {
  body {
    padding-top: 64px !important;
  }

  .contest-card {
    max-width: 95% !important;
  }
}

/* --- Tablets: 641px – 1024px --- */
@media (min-width: 641px) and (max-width: 1024px) {
  body {
    padding-top: 70px !important;
  }

  .top-header img {
    height: 65px !important;
    max-width: 220px !important;
  }

  .bottom-nav {
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 15px 15px 0 0 !important;
  }

  .nav-item {
    font-size: 13px !important;
  }

  .nav-item i {
    font-size: 20px !important;
  }

  .container {
    max-width: 700px;
  }

  .contest-card {
    max-width: 500px !important;
  }

  .tasks {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .buttons a {
    flex: 1 1 calc(50% - 5px) !important;
  }
}

/* --- Desktop: 1025px+ --- */
@media (min-width: 1025px) {
  body {
    padding-top: 75px !important;
  }

  .top-header img {
    height: 70px !important;
    max-width: 250px !important;
  }

  .bottom-nav {
    max-width: 500px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 15px !important;
    bottom: 10px !important;
  }

  .container {
    max-width: 800px;
  }

  .modal-content {
    margin: 80px auto !important;
  }

  .sidebar {
    width: 320px !important;
  }

  .tasks {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
  }

  .buttons a {
    flex: 1 1 calc(50% - 5px) !important;
  }
}

/* --- Landscape phone fix --- */
@media (max-height: 500px) and (orientation: landscape) {
  .top-header {
    padding: 5px 0 !important;
  }

  .top-header img {
    height: 35px !important;
  }

  body {
    padding-top: 50px !important;
  }

  .bottom-nav {
    padding: 6px 0 !important;
  }

  .nav-item {
    font-size: 10px !important;
  }

  .modal-content {
    margin: 10px auto !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .avatar {
    width: 60px !important;
    height: 60px !important;
    margin: 5px auto 10px !important;
  }
}

/* --- Touch friendly sizing --- */
@media (hover: none) and (pointer: coarse) {
  button, .btn, .login-submit-btn, .notify-btn, .pnotify-btn, .submit-btn,
  .nav-item, a.btn, .buttons a, .menu-list a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================
   PRINT — hide nav for printing
============================================ */
@media print {
  .bottom-nav, .top-header, .sidebar, .modal {
    display: none !important;
  }
  body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}
