/* ============================================================
   eShtreber — styles.css
   Mobile-first, emoji-safe, safe-area aware
   ============================================================ */

/* ===== RESET & ROOT ===== */
:root {
  --bg:          #fff9f0;
  --surface:     #ffffff;
  --border:      #f0d9b5;
  --border2:     #e8c98a;
  --accent:      #ff6b6b;
  --accent2:     #ffa94d;
  --blue:        #4dabf7;
  --purple:      #cc5de8;
  --green:       #51cf66;
  --red:         #ff6b6b;
  --text:        #2d2d2d;
  --muted:       #b0b8c8;
  --shadow:      0 4px 20px rgba(0,0,0,.07);
  --shadow-pop:  0 8px 32px rgba(0,0,0,.12);
  --radius:      1.1rem;
  --nav-h:       calc(3.8rem + env(safe-area-inset-bottom));
}

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

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

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 10% 15%, #ffe8e8 0%, transparent 38%),
    radial-gradient(circle at 90% 85%, #e8f4ff 0%, transparent 38%),
    radial-gradient(circle at 50% 50%, #fff3e0 0%, transparent 55%);
  /* Fix for iOS 100vh bug */
  min-height: -webkit-fill-available;
}

/* Emoji always render with system font, never get clipped */
.bnav-icon, .role-icon, .rc-icon, .page-title,
.logo-star, .auth-logo h1, .empty-state::before {
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",
               "Twemoji Mozilla", sans-serif;
  line-height: 1;
  display: block;
}

::-webkit-scrollbar       { width: 4px }
::-webkit-scrollbar-thumb { background: var(--accent2); border-radius: 99px }

/* ===== DECO BLOBS ===== */
.deco-blob {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0; opacity: .1;
}
.deco1 { width:280px; height:280px; background:#ff6b6b; top:-70px; left:-70px;
          animation: fl1 9s ease-in-out infinite; }
.deco2 { width:200px; height:200px; background:#4dabf7; bottom:-50px; right:-50px;
          animation: fl2 11s ease-in-out infinite; }
.deco3 { width:140px; height:140px; background:#cc5de8; top:38%; right:-35px;
          animation: fl1 13s ease-in-out infinite reverse; }

@keyframes fl1 { 0%,100%{transform:translate(0,0) rotate(0deg)} 50%{transform:translate(8px,-14px) rotate(5deg)} }
@keyframes fl2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-7px,11px)} }

/* ===== ERROR SCREEN ===== */
#view-error{
  display: none;	
  background-color: var(--bg);
  width: 100%;
  height: 100%;
  z-index: 9999;
} 
#error-messages{	
  left: 45%;
  position: absolute;
  top: 50%;
  background: rgba(255,107,107,.07);
  box-shadow: 0 4px 14px rgba(255,107,107,.18);
  border: 2.5px solid var(--accent);
  padding: .85rem .7rem;
  border-radius: 1.2rem;
}
#error-message{  
  max-width: 90%;
  text-align: center;
}
 
/* ===== AUTH SCREEN ===== */
#authScreen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 999; overflow-y: auto; padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: 2.5rem;
  padding: 1.75rem 1.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(255,107,107,.12), var(--shadow-pop);
  position: relative; z-index: 1;
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes popIn {
  from { opacity:0; transform:scale(.87) translateY(18px) }
  to   { opacity:1; transform:none }
}

.auth-logo { text-align: center; margin-bottom: 1.4rem; }
.auth-logo .logo-star {
  font-size: 2rem; margin-bottom: .2rem;
  animation: spinStar 5s linear infinite;
}
@keyframes spinStar { to { transform: rotate(360deg) } }

.auth-logo h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p { color: var(--muted); font-size: .8rem; font-weight: 700; margin-top: .2rem; }

.tab-switcher {
  display: flex; gap: .2rem; padding: .22rem;
  background: #f8f0e8; border: 2px solid var(--border);
  border-radius: 1.2rem; margin-bottom: 1.2rem;
}
.tab-btn {
  flex: 1; padding: .58rem; border: none; border-radius: .9rem;
  background: transparent; color: var(--muted);
  cursor: pointer; font-size: .78rem; font-weight: 800;
  font-family: 'Nunito', sans-serif; transition: all .22s;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(255,107,107,.35);
}

.field {
  width: 100%; background: #fdf6ec;
  border: 2.5px solid var(--border); color: var(--text);
  padding: .82rem 1rem; border-radius: var(--radius);
  outline: none; font-size: 1rem; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  margin-bottom: .55rem; display: block;
  transition: border-color .2s, box-shadow .2s;
  /* Prevent zoom on iOS */
  font-size: max(1rem, 16px);
}
.field:focus { border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(255,169,77,.14); }
.field option { background: #fff; }
.field-code {
  text-align: center; font-weight: 900;
  color: var(--accent2); text-transform: uppercase;
  letter-spacing: .08em;
}

.section-label {
  font-size: .62rem; font-weight: 900;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: .42rem; display: block; letter-spacing: .07em;
}

/* Avatar grid */
.avatar-grid {
  display: grid; grid-template-columns: repeat(8,1fr);
  gap: .25rem; margin-bottom: .75rem;
}
.avatar-opt {
  aspect-ratio: 1; border-radius: .6rem;
  border: 2.5px solid transparent; cursor: pointer;
  background: #f8f0e8; padding: .12rem; opacity: .38;
  transition: all .17s; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.avatar-opt svg, .avatar-opt img { width:100%; height:100%; display:block; }
.avatar-opt.selected {
  border-color: var(--accent); opacity: 1;
  transform: scale(1.12); box-shadow: 0 4px 12px rgba(255,107,107,.3);
}

/* Role toggle */
.role-toggle { display: grid; grid-template-columns:1fr 1fr; gap:.5rem; margin-bottom:.7rem; }
.role-card {
  background: #fdf6ec; border: 2.5px solid var(--border);
  border-radius: 1.2rem; padding: .85rem .7rem;
  text-align: center; cursor: pointer; transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.role-card.selected {
  border-color: var(--accent); background: rgba(255,107,107,.07);
  box-shadow: 0 4px 14px rgba(255,107,107,.18); transform: translateY(-2px);
}
.role-card .role-icon { font-size: 1.9rem; margin-bottom: .25rem; }
.role-card .role-label {
  font-size: .7rem; font-weight: 900;
  text-transform: uppercase; color: var(--muted);
  font-family: 'Nunito', sans-serif;
}
.role-card.selected .role-label { color: var(--accent); }

/* Primary button */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; padding: .95rem;
  border-radius: 1.2rem; font-weight: 900; font-size: .95rem;
  cursor: pointer; margin-top: .45rem; font-family: 'Nunito', sans-serif;
  transition: all .18s; box-shadow: 0 6px 20px rgba(255,107,107,.32);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(.97); }
.btn-danger {
  background: linear-gradient(135deg,#ff8787,#ffa8a8) !important;
  box-shadow: 0 6px 20px rgba(255,107,107,.25) !important;
}

/* ===== APP SHELL ===== */
#app { display:none; flex-direction:column; height:100%; position:relative; z-index:1; }
#app.visible { display:flex; }

/* HEADER */
header {
  background: rgba(255,249,240,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 2.5px solid var(--border);
  padding: .7rem 1rem;
  padding-top: calc(.7rem + env(safe-area-inset-top));
  display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0;
  box-shadow: var(--shadow); gap: .5rem;
}
.logo {
  font-family: 'Fredoka One', cursive; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; cursor: pointer; user-select: none;
  white-space: nowrap;
}
#schoolBadge {
  font-size: .55rem; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(255,169,77,.15);
  color: var(--accent2); border: 1.5px solid rgba(255,169,77,.3);
  border-radius: .6rem; padding: .22rem .5rem;
  white-space: nowrap; flex-shrink: 0;
  /* hide on very small screens */
  max-width: 100px; overflow: hidden; text-overflow: ellipsis;
}
.header-av {
  width: 2.4rem; height: 2.4rem; border-radius: .85rem;
  overflow: hidden; border: 2.5px solid var(--accent);
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(255,107,107,.2);
  transition: transform .15s; -webkit-tap-highlight-color: transparent;
}
.header-av:active { transform: scale(.93); }
.header-av svg { width:100%; height:100%; }

/* MAIN */
main { flex:1; overflow:hidden; min-height: 0; }

.view {
  display: none; height: 100%;
  flex-direction: column; overflow: hidden;
}
.view.active { display: flex; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  background: rgba(255,249,240,.97);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 2.5px solid var(--border);
  padding: .35rem .4rem;
  padding-bottom: calc(.35rem + env(safe-area-inset-bottom));
  display: flex; align-items: center;
  justify-content: space-around; flex-shrink: 0;
  box-shadow: 0 -4px 18px rgba(0,0,0,.06);
}

.bnav-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .1rem; border: none; background: transparent;
  cursor: pointer; padding: .4rem .5rem;
  border-radius: .9rem; transition: all .18s;
  color: var(--muted); min-width: 3rem; min-height: 3rem;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* The emoji icon — guaranteed to show on all phones */
.bnav-icon {
  font-size: 1.45rem;
  line-height: 1;
  display: block;
  width: 1.7rem; height: 1.7rem;
  text-align: center;
  /* force emoji rendering */
  font-family: "Apple Color Emoji","Segoe UI Emoji",
               "Noto Color Emoji","Twemoji Mozilla",sans-serif;
  transition: transform .2s;
  /* prevent icon getting clipped */
  overflow: visible;
}

.bnav-label {
  font-size: .48rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em;
  font-family: 'Nunito', sans-serif;
  line-height: 1; white-space: nowrap;
}

.bnav-pip {
  width: .34rem; height: .34rem;
  background: var(--accent); border-radius: 50%;
  display: none;
}

.bnav-btn.active { color: var(--accent); }
.bnav-btn.active .bnav-icon { transform: scale(1.18); }
.bnav-btn.active .bnav-pip  { display: block; }
.bnav-btn:active { opacity: .7; }

/* ===== CHAT / WALL ===== */
.chat-messages {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 1rem; display: flex; flex-direction: column; gap: .6rem;
}

.msg-wrap { display:flex; flex-direction:column; max-width:78%; }
.msg-wrap.mine   { align-self:flex-end; align-items:flex-end; }
.msg-wrap.theirs { align-self:flex-start; align-items:flex-start; }

.msg-meta {
  display:flex; align-items:center; gap:.28rem;
  margin-bottom:.18rem; padding:0 .3rem;
}
.msg-meta .av-tiny {
  width:1.5rem; height:1.5rem; border-radius:50%;
  overflow:hidden; flex-shrink:0;
  background:#f8f0e8; border:2px solid var(--border);
}
.msg-meta .av-tiny svg { width:100%; height:100%; }
.msg-meta span {
  font-size:.56rem; font-weight:800;
  text-transform:uppercase; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:none;
}

.bubble {
  padding:.65rem .95rem; border-radius:1.35rem;
  font-size:.9rem; font-weight:600; line-height:1.45;
  word-break:break-word; white-space:pre-wrap;
}
.bubble.mine {
  background:linear-gradient(135deg,var(--accent),#ff8787);
  color:#fff; border-bottom-right-radius:.35rem;
  box-shadow:0 4px 14px rgba(255,107,107,.28);
}
.bubble.theirs {
  background:var(--surface); border:2.5px solid var(--border);
  border-bottom-left-radius:.35rem; box-shadow:var(--shadow);
}

/* Chat form */
.chat-form {
  padding: .65rem; padding-bottom: .65rem;
  background: rgba(255,249,240,.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; gap: .4rem;
  border-top: 2.5px solid var(--border);
  flex-shrink: 0; align-items: center;
}
.chat-form input {
  flex:1; min-width:0; background:#fdf6ec;
  border:2.5px solid var(--border); color:var(--text);
  padding:.65rem .9rem; border-radius:1rem;
  outline:none; font-size:max(1rem,16px);
  font-family:'Nunito',sans-serif; font-weight:600;
  transition:all .2s;
}
.chat-form input:focus { border-color:var(--accent2); box-shadow:0 0 0 4px rgba(255,169,77,.12); }

/* image upload label = icon button */
.btn-icon-action {
  background:#fdf6ec; border:2.5px solid var(--border);
  width:2.65rem; height:2.65rem; border-radius:.95rem;
  cursor:pointer; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  transition:all .18s; -webkit-tap-highlight-color:transparent;
  font-size:1.15rem;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.btn-icon-action:active { border-color:var(--accent2); transform:scale(.93); }

.btn-send {
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  border:none; color:#fff;
  width:2.65rem; height:2.65rem; border-radius:.95rem;
  cursor:pointer; font-size:1rem; flex-shrink:0;
  transition:all .18s; box-shadow:0 4px 12px rgba(255,107,107,.28);
  display:flex; align-items:center; justify-content:center;
  -webkit-tap-highlight-color:transparent;
}
.btn-send:active { transform:scale(.92); }

/* ===== CHAT HEADER ===== */
.chat-header {
  padding:.7rem 1rem;
  background:rgba(255,249,240,.97);
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  border-bottom:2.5px solid var(--border);
  display:flex; align-items:center; gap:.65rem;
  flex-shrink:0; box-shadow:var(--shadow);
}
.chat-header h3 {
  font-size:.88rem; font-weight:800; flex:1;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.btn-back {
  background:#fdf6ec; border:2px solid var(--border); color:var(--text);
  cursor:pointer; font-size:.85rem; padding:.42rem .65rem;
  border-radius:.72rem; transition:all .18s;
  font-family:'Nunito',sans-serif; font-weight:800;
  -webkit-tap-highlight-color:transparent;
}
.btn-back:active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ===== PAGES ===== */
.page-inner {
  flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:1rem;
}
.page-center { display:flex; justify-content:center; }
.page-narrow { max-width:620px; margin:0 auto; width:100%; }

.page-title {
  font-family:'Fredoka One',cursive; font-size:1.45rem;
  color:var(--text); margin-bottom:.85rem;
  display:flex; align-items:center; gap:.35rem;
}

.search-bar {
  width:100%; background:var(--surface);
  border:2.5px solid var(--border); color:var(--text);
  padding:.7rem 1rem; border-radius:1.2rem; outline:none;
  font-size:max(1rem,16px); font-family:'Nunito',sans-serif; font-weight:700;
  margin-bottom:1rem; display:block; transition:all .2s;
}
.search-bar:focus { border-color:var(--accent2); box-shadow:0 0 0 4px rgba(255,169,77,.12); }

/* ===== TUTORS ===== */
.tutor-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
  gap:.8rem;
}
.tutor-card {
  background:var(--surface); border:2.5px solid var(--border);
  border-radius:1.6rem; padding:1.2rem .9rem;
  display:flex; flex-direction:column; align-items:center;
  text-align:center; transition:all .22s; box-shadow:var(--shadow);
}
.tutor-card:active { border-color:var(--accent2); transform:translateY(-3px); box-shadow:var(--shadow-pop); }
.tutor-av {
  width:4.2rem; height:4.2rem; border-radius:1.1rem;
  background:#f8f0e8; border:2.5px solid var(--border);
  overflow:hidden; margin-bottom:.65rem; flex-shrink:0;
}
.tutor-av svg { width:100%; height:100%; }
.tutor-card h3 { font-size:.78rem; font-weight:900; margin-bottom:.18rem; word-break:break-word; line-height:1.3; }
.tutor-card .subj {
  color:var(--accent2); font-size:.62rem; font-weight:800;
  text-transform:uppercase; margin-bottom:.5rem; letter-spacing:.04em;
}
.tutor-card .grade-preview {
  font-size:.6rem; color:var(--muted); font-weight:700;
  margin-bottom:.55rem; display:flex; gap:.22rem; flex-wrap:wrap; justify-content:center;
}
.tutor-card .grade-preview .gp {
  background:rgba(255,169,77,.15); color:var(--accent2);
  border-radius:.4rem; padding:.1rem .32rem; font-weight:900;
}
.btn-book {
  width:100%;
  background:linear-gradient(135deg,var(--blue),#74c0fc);
  color:#fff; border:none; padding:.52rem; border-radius:.85rem;
  font-weight:800; font-size:.7rem; text-transform:uppercase;
  letter-spacing:.04em; cursor:pointer; font-family:'Nunito',sans-serif;
  transition:all .18s; box-shadow:0 4px 12px rgba(77,171,247,.28);
  -webkit-tap-highlight-color:transparent;
}
.btn-book:active { transform:scale(.96); }

/* ===== GRADES ===== */
.grades-wrap {
  width:100%; max-width:540px;
  background:var(--surface); border:2.5px solid var(--border);
  border-radius:1.9rem; padding:1.5rem; box-shadow:var(--shadow-pop);
}
.grade-add {
  display:flex; gap:.38rem; background:#fdf6ec;
  border:2.5px solid var(--border); border-radius:1.2rem;
  padding:.7rem; margin-bottom:1.1rem;
  align-items:center; flex-wrap:wrap;
}
.grade-subj-input {
  flex:1; min-width:100px; background:transparent;
  border:none; color:var(--text); outline:none;
  font-size:max(1rem,16px); font-weight:700; font-family:'Nunito',sans-serif;
}
.grade-num-input {
  width:3rem; text-align:center; background:var(--surface);
  border:2px solid var(--border); border-radius:.6rem; padding:.28rem;
  color:var(--text); font-size:.95rem; font-weight:700;
  font-family:'Nunito',sans-serif; outline:none;
}
.grade-add-btn {
  background:linear-gradient(135deg,var(--green),#69db7c);
  border:none; color:#fff; width:2.35rem; height:2.35rem;
  border-radius:.85rem; cursor:pointer; font-size:1.2rem;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; box-shadow:0 4px 12px rgba(81,207,102,.32);
  transition:all .18s; -webkit-tap-highlight-color:transparent;
}
.grade-add-btn:active { transform:scale(.92); }
.grade-row {
  background:#fdf6ec; border:2.5px solid var(--border);
  border-radius:1.2rem; padding:.8rem 1rem;
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:.5rem; gap:.55rem; transition:all .18s;
}
.grade-row:active { border-color:var(--border2); }
.grade-row-left { display:flex; align-items:center; gap:.5rem; min-width:0; }
.sub-name {
  font-size:.62rem; font-weight:900; text-transform:uppercase;
  color:var(--muted); white-space:nowrap; letter-spacing:.05em;
}
.btn-del-subj {
  background:none; border:none; cursor:pointer;
  color:#ffb3b3; font-size:.85rem; padding:.1rem; line-height:1;
  transition:color .15s; flex-shrink:0;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}
.btn-del-subj:active { color:var(--red); }
.grade-chips { display:flex; gap:.28rem; flex-wrap:wrap; justify-content:flex-end; align-items:center; }
.chip {
  width:1.9rem; height:1.9rem; display:flex;
  align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--accent2),#ffd43b);
  color:#fff; border-radius:.52rem; font-size:.76rem; font-weight:900;
  box-shadow:0 2px 8px rgba(255,169,77,.28); cursor:pointer;
  position:relative; transition:all .15s; -webkit-tap-highlight-color:transparent;
}
.chip:active { transform:scale(1.18); box-shadow:0 3px 12px rgba(255,107,107,.35); }
.chip:active::after {
  content:'✕'; position:absolute; inset:0;
  background:rgba(255,87,87,.85); border-radius:.52rem;
  display:flex; align-items:center; justify-content:center; font-size:.6rem;
}

/* ===== BOOKINGS / NOTIFICATIONS ===== */
.booking-card {
  background:var(--surface); border:2.5px solid var(--border);
  border-radius:1.35rem; padding:.85rem .95rem;
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:.55rem; gap:.55rem; box-shadow:var(--shadow);
  transition:all .2s;
}
.booking-card:active { transform:translateY(-1px); box-shadow:var(--shadow-pop); }
.booking-info { display:flex; align-items:center; gap:.65rem; min-width:0; }
.booking-av {
  width:2.7rem; height:2.7rem; border-radius:.85rem;
  background:#f8f0e8; border:2px solid var(--border); overflow:hidden; flex-shrink:0;
}
.booking-av svg { width:100%; height:100%; }
.booking-info h4 { font-size:.82rem; font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.booking-info p  { font-size:.62rem; font-weight:700; color:var(--muted); margin-top:.1rem; }
.booking-actions { display:flex; gap:.32rem; flex-shrink:0; }

.btn-accept {
  background:rgba(81,207,102,.14); color:var(--green);
  border:2px solid rgba(81,207,102,.28); padding:.48rem .62rem;
  border-radius:.82rem; cursor:pointer; font-size:1rem;
  transition:all .18s; line-height:1;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.btn-accept:active { background:rgba(81,207,102,.28); transform:scale(1.1); }

.btn-reject {
  background:rgba(255,107,107,.1); color:var(--red);
  border:2px solid rgba(255,107,107,.2); padding:.48rem .62rem;
  border-radius:.82rem; cursor:pointer; font-size:1rem;
  transition:all .18s; line-height:1;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.btn-reject:active { background:rgba(255,107,107,.22); transform:scale(1.1); }

.btn-chat {
  background:linear-gradient(135deg,var(--blue),#74c0fc);
  color:#fff; border:none; padding:.48rem .75rem;
  border-radius:.82rem; font-size:.68rem; font-weight:800;
  text-transform:uppercase; cursor:pointer;
  font-family:'Nunito',sans-serif; transition:all .18s;
  box-shadow:0 4px 10px rgba(77,171,247,.22);
  -webkit-tap-highlight-color:transparent;
}
.btn-chat:active { transform:scale(.95); }

/* ===== SETTINGS ===== */
.settings-card {
  background:var(--surface); border:2.5px solid var(--border);
  border-radius:1.9rem; padding:1.5rem;
  width:100%; max-width:420px; box-shadow:var(--shadow-pop);
}
.profile-avatar { display:flex; flex-direction:column; align-items:center; margin-bottom:1.2rem; }
.profile-av-wrap {
  width:5.2rem; height:5.2rem; background:#f8f0e8;
  border-radius:1.55rem; border:3px solid var(--accent);
  overflow:hidden; margin-bottom:.65rem;
  box-shadow:0 8px 24px rgba(255,107,107,.18);
}
.profile-av-wrap svg { width:100%; height:100%; }

.av-scroller {
  display:grid; grid-template-columns:repeat(8,2.35rem);
  gap:.25rem; overflow-x:auto; width:100%; padding:.25rem 0;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.av-scroller::-webkit-scrollbar { display:none; }

.profile-field {
  background:#fdf6ec; border:2.5px solid var(--border);
  border-radius:1.05rem; padding:.75rem .9rem;
  margin-bottom:.5rem; transition:border-color .2s;
}
.profile-field:focus-within { border-color:var(--accent2); }
.profile-field label {
  display:block; font-size:.58rem; font-weight:900;
  text-transform:uppercase; color:var(--muted);
  margin-bottom:.18rem; letter-spacing:.06em;
}
.profile-field input, .profile-field select {
  width:100%; background:transparent; border:none; color:var(--text);
  outline:none; font-size:max(1rem,16px); font-weight:700; font-family:'Nunito',sans-serif;
}

.section-divider {
  font-size:.58rem; font-weight:900; text-transform:uppercase;
  letter-spacing:.08em; color:var(--muted);
  margin:.8rem 0 .4rem; display:block;
}

.role-switch { display:grid; grid-template-columns:1fr 1fr; gap:.45rem; margin-bottom:.55rem; }
.role-chip {
  background:#fdf6ec; border:2.5px solid var(--border);
  border-radius:1rem; padding:.7rem .5rem;
  text-align:center; cursor:pointer; transition:all .18s;
  -webkit-tap-highlight-color:transparent;
}
.role-chip:active { border-color:var(--accent2); }
.role-chip.active {
  border-color:var(--accent); background:rgba(255,107,107,.07);
  box-shadow:0 4px 12px rgba(255,107,107,.16);
}
.role-chip .rc-icon { font-size:1.5rem; margin-bottom:.2rem; }
.role-chip .rc-label {
  font-size:.68rem; font-weight:900;
  text-transform:uppercase; color:var(--muted); font-family:'Nunito',sans-serif;
}
.role-chip.active .rc-label { color:var(--accent); }

.tutor-subj-section {
  background:#fdf6ec; border:2.5px solid var(--border);
  border-radius:1.2rem; padding:.8rem 1rem; margin-bottom:.5rem;
}
.tutor-subj-section label {
  font-size:.62rem; font-weight:900; text-transform:uppercase;
  color:var(--muted); letter-spacing:.06em; display:block; margin-bottom:.4rem;
}
.tutor-subj-select {
  width:100%; background:transparent; border:none; color:var(--text);
  outline:none; font-size:max(1rem,16px); font-weight:700;
  font-family:'Nunito',sans-serif; cursor:pointer;
}

/* ===== TOAST ===== */
#toast {
  position:fixed; top:5rem; right:1rem;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#fff; padding:.62rem 1.05rem; border-radius:1.2rem;
  font-size:.78rem; font-weight:800; z-index:9999;
  opacity:0; transform:translateY(-10px) scale(.9);
  transition:all .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events:none; font-family:'Nunito',sans-serif;
  box-shadow:0 8px 24px rgba(255,107,107,.32);
  max-width:calc(100vw - 2rem);
}
#toast.show { opacity:1; transform:none; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align:center; padding:3rem 1rem;
  color:var(--muted); font-size:.78rem; font-weight:800;
  text-transform:uppercase; letter-spacing:.06em;
}
.empty-state::before {
  content:'🌈'; display:block; font-size:2.2rem;
  margin-bottom:.65rem; opacity:.55;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
}

/* ===== RESPONSIVE TWEAKS ===== */

/* Very small phones (iPhone SE, 320px) */
@media (max-width: 360px) {
  .avatar-grid { grid-template-columns: repeat(6,1fr); }
  .bnav-btn    { min-width:2.6rem; padding:.38rem .3rem; }
  .bnav-icon   { font-size:1.3rem; }
  .bnav-label  { font-size:.42rem; }
  .tutor-grid  { grid-template-columns: repeat(2,1fr); }
  #schoolBadge { display:none; }
}

/* Normal phones */
@media (max-width: 480px) {
  .auth-card { border-radius:2rem; padding:1.5rem 1.2rem; }
  .tutor-grid { grid-template-columns: repeat(2,1fr); }
  .grades-wrap { border-radius:1.4rem; padding:1.1rem; }
  .settings-card { border-radius:1.4rem; padding:1.1rem; }
}

/* Tablet and up */
@media (min-width: 600px) {
  .bnav-icon  { font-size:1.55rem; }
  .bnav-label { font-size:.55rem; }
  .tutor-grid { grid-template-columns: repeat(auto-fill,minmax(165px,1fr)); }
}

/* Landscape phones — reduce header/nav height */
@media (max-height: 500px) and (orientation: landscape) {
  header { padding:.4rem 1rem; }
  .bottom-nav { padding:.2rem .4rem; padding-bottom:calc(.2rem + env(safe-area-inset-bottom)); }
  .bnav-icon  { font-size:1.2rem; width:1.4rem; height:1.4rem; }
  .bnav-label { display:none; }
  .bnav-pip   { display:none !important; }
}
