/* ===================================================================
   RAWM STUDENT APP — GLOBAL TOKENS & SHELL
   Shared across all pages. Page-specific styles live in their own
   /assets/css/<page>.css file and load AFTER this one.
   =================================================================== */

:root{
  /* ---- Brand colors (sampled from rawm-logo.png) ---- */
  --rawm-ink:        #1F1E20;   /* deep charcoal — header, login bg */
  --rawm-charcoal:   #565656;   /* logo gray */
  --rawm-charcoal-2: #87858A;   /* muted secondary text */
  --rawm-orange:     #EE7F2D;   /* logo arrow orange */
  --rawm-orange-deep:#C9621A;   /* pressed / hover */
  --rawm-orange-tint:#FBE6D4;   /* soft chip backgrounds */
  --rawm-cream:      #FBF9F6;   /* app background */
  --rawm-surface:    #FFFFFF;   /* cards */
  --rawm-line:       #EAE6E1;   /* hairline dividers */
  --rawm-line-strong:#DBD6CF;

  /* ---- Type ---- */
  --font-display:'Oswald', sans-serif;
  --font-body:'Inter', sans-serif;

  /* ---- App shell metrics ---- */
  --header-h: 60px;
  --footer-h: 70px;
}

*{ box-sizing:border-box; }

html,body{
  height:100%;
  font-family:var(--font-body);
  color:var(--rawm-charcoal);
  -webkit-tap-highlight-color:transparent;
}

body{
  margin:0;
  background:var(--rawm-cream);
}

a{ text-decoration:none; }
button{ font-family:inherit; }

/* ===================================================================
   APP FRAME
   On a real phone (<=480px) this fills the screen edge to edge.
   On a wider screen it simulates a phone so the "app, not website"
   intent reads clearly even on desktop.
   =================================================================== */
.app-frame{
  width:100%;
  height:100vh;
  height:100dvh; /* accounts for mobile browser chrome correctly where supported */
  margin:0 auto;
  display:flex;
  flex-direction:column;
  background:var(--rawm-cream);
  position:relative;
  overflow:hidden;
}

/* ---- Header (sticky inside the frame, not the viewport) ---- */
.app-header{
  flex:0 0 auto;
  height:calc(var(--header-h) + env(safe-area-inset-top));
  padding-top:env(safe-area-inset-top);
  background:var(--rawm-ink);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-left:16px;
  padding-right:16px;
  position:relative;
  z-index:5;
  background-image:repeating-linear-gradient(
      180deg,
      rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 2px,
      transparent 2px, transparent 7px
  );
}

.app-header .brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.app-header .brand img{
  width:34px;
  height:34px;
  border-radius:9px;
  display:block;
}

.app-header .brand-name{
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:.06em;
  font-size:16px;
  color:#fff;
  line-height:1;
}

.app-header .brand-name small{
  display:block;
  font-family:var(--font-body);
  font-weight:400;
  letter-spacing:0;
  font-size:10px;
  color:#A8A6A3;
  margin-top:2px;
}

.icon-btn{
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:17px;
  transition:background .15s ease;
}
.icon-btn:active{ background:rgba(255,255,255,.18); }

/* ---- Scrollable content area ---- */
.app-content{
  flex:1 1 auto;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.app-content::-webkit-scrollbar{ display:none; }

/* ---- Footer nav (sticky inside the frame) ---- */
.app-footer{
  flex:0 0 auto;
  height:calc(var(--footer-h) + env(safe-area-inset-bottom));
  padding-bottom:env(safe-area-inset-bottom);
  background:var(--rawm-surface);
  border-top:1px solid var(--rawm-line);
  display:flex;
  align-items:stretch;
  z-index:5;
}

.app-footer .nav-item{
  flex:1 1 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:var(--rawm-charcoal-2);
  font-size:10.5px;
  font-weight:500;
  position:relative;
}

.app-footer .nav-item i{
  font-size:19px;
  line-height:1;
}

.app-footer .nav-item.active{
  color:var(--rawm-orange-deep);
}

.app-footer .nav-item.active::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:26px;
  height:3px;
  border-radius:0 0 3px 3px;
  background:var(--rawm-orange);
}

/* ===================================================================
   SHARED COMPONENTS
   =================================================================== */

/* Section eyebrow — reuses the logo's arrow mark as a brand-true bullet */
.section-eyebrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}

.section-eyebrow .eyebrow-title{
  display:flex;
  align-items:center;
  gap:7px;
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:.03em;
  font-size:14.5px;
  color:var(--rawm-ink);
  text-transform:uppercase;
}

.section-eyebrow .eyebrow-title svg{
  width:13px;
  height:11px;
  flex:0 0 auto;
}

.section-eyebrow .eyebrow-link{
  font-size:12px;
  font-weight:600;
  color:var(--rawm-orange-deep);
  display:flex;
  align-items:center;
  gap:2px;
}

.section-block{
  padding:18px 16px 4px;
}

.card-surface{
  background:var(--rawm-surface);
  border:1px solid var(--rawm-line);
  border-radius:16px;
}

/* Generic confirm modal tweaks (logout, forgot password) */
.modal-content{
  border-radius:18px;
  border:none;
}
.modal-header{
  border-bottom:1px solid var(--rawm-line);
}
.modal-footer{
  border-top:1px solid var(--rawm-line);
}
.btn-rawm-primary{
  background:var(--rawm-orange);
  border-color:var(--rawm-orange);
  color:#fff;
  font-weight:600;
}
.btn-rawm-primary:hover,
.btn-rawm-primary:active{
  background:var(--rawm-orange-deep);
  border-color:var(--rawm-orange-deep);
  color:#fff;
}
.btn-rawm-outline{
  background:transparent;
  border:1px solid var(--rawm-line-strong);
  color:var(--rawm-charcoal);
  font-weight:600;
}

/* Generic invalid form-field state, usable on any input/select/textarea */
.is-invalid-rawm{
  border-color:#E2693A !important;
}

/* Logout confirm dialog — compact centered card with a divided
   two-button footer row */
.logout-dialog{
  max-width:300px;
  margin:0 auto;
}
.logout-card{
  border:none;
  border-radius:16px;
  padding:24px 20px 0;
  text-align:center;
  overflow:hidden;
  box-shadow:0 24px 60px -12px rgba(0,0,0,.35);
}
.logout-title{
  font-family:var(--font-display);
  font-weight:700;
  font-size:18px;
  color:#D6432F;
  margin:0 0 8px;
}
.logout-text{
  font-size:13px;
  color:var(--rawm-charcoal);
  margin:0 0 20px;
}
.logout-actions{
  display:flex;
  border-top:1px solid var(--rawm-line);
  margin:0 -20px;
}
.logout-btn{
  flex:1 1 0;
  border:none;
  background:none;
  padding:14px 0;
  font-size:14px;
  font-weight:600;
}
.logout-cancel{
  color:var(--rawm-charcoal-2);
  border-right:1px solid var(--rawm-line);
}
.logout-confirm{
  color:var(--rawm-orange-deep);
}

/* ---- Inner-page header (back + title), used by pages other than index ---- */
.page-header .page-head-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.page-header .page-title{
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:.02em;
  font-size:15.5px;
  color:#fff;
  margin:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ---- Shared category filter chips (Gallery, Tutorials, etc.) ---- */
.chip-filter{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:2px;
  scrollbar-width:none;
}
.chip-filter::-webkit-scrollbar{ display:none; }

.filter-chip{
  flex:0 0 auto;
  border:1px solid var(--rawm-line);
  background:var(--rawm-surface);
  color:var(--rawm-charcoal);
  font-size:12px;
  font-weight:600;
  padding:8px 16px;
  border-radius:20px;
  white-space:nowrap;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-chip.active{
  background:var(--rawm-ink);
  border-color:var(--rawm-ink);
  color:#fff;
}

/* ---- Shared 2-column video grid (Tutorials, Promotional Videos) ---- */
.video-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.video-card{
  background:var(--rawm-surface);
  border:1px solid var(--rawm-line);
  border-radius:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.video-thumb{
  position:relative;
  aspect-ratio:16/9;
  background:var(--rawm-line);
  overflow:hidden;
  flex:0 0 auto;
}
.video-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.video-play{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg, rgba(0,0,0,.05) 50%, rgba(0,0,0,.35) 100%);
}
.video-play i{
  font-size:30px;
  color:#fff;
  filter:drop-shadow(0 4px 10px rgba(0,0,0,.45));
}
.video-duration{
  position:absolute;
  right:6px;
  bottom:6px;
  background:rgba(0,0,0,.65);
  color:#fff;
  font-size:9.5px;
  font-weight:600;
  padding:2px 6px;
  border-radius:5px;
}

.video-info{
  padding:9px 10px 11px;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.video-title{
  font-size:11.5px;
  font-weight:600;
  color:var(--rawm-ink);
  line-height:1.3;
  margin:0 0 3px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.video-sub{
  font-size:10px;
  color:var(--rawm-charcoal-2);
  margin:0;
}

/* ---- Shared video player modal ---- */
.video-modal-dialog{
  max-width:94%;
  margin:0 auto;
}
.video-modal-content{
  background:transparent;
  border:none;
  box-shadow:none;
}
.video-frame-wrap{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  border-radius:14px;
  overflow:hidden;
  background:#000;
}
.video-frame-wrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}
.video-modal-title{
  color:#fff;
  text-align:center;
  font-size:13px;
  font-weight:500;
  margin:12px 4px 0;
}
.video-modal-close{
  position:absolute;
  top:-40px;
  right:0;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.1);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}

/* ===================================================================
   PAGE LOADER
   Shown on every page while assets finish loading; faded out by
   global.js once the window 'load' event fires.
   =================================================================== */
.page-loader{
  position:fixed;
  inset:0;
  z-index:9999;
  background:var(--rawm-cream);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
  transition:opacity .35s ease, visibility .35s ease;
}
.page-loader.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.loader-logo{
  width:60px;
  height:60px;
  border-radius:16px;
  box-shadow:0 16px 30px -12px rgba(0,0,0,.25);
  animation:rawmLoaderPulse 1.1s ease-in-out infinite;
}
.loader-bar{
  width:110px;
  height:4px;
  border-radius:3px;
  background:var(--rawm-line);
  overflow:hidden;
  position:relative;
}
.loader-bar-fill{
  position:absolute;
  top:0;
  left:-40%;
  height:100%;
  width:40%;
  border-radius:3px;
  background:var(--rawm-orange);
  animation:rawmLoaderSlide 1.1s ease-in-out infinite;
}
@keyframes rawmLoaderPulse{
  0%, 100%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(.92); opacity:.75; }
}
@keyframes rawmLoaderSlide{
  0%{ left:-40%; }
  100%{ left:100%; }
}
.toast-container{
  position:absolute;
  bottom:calc(var(--footer-h) + 12px);
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  z-index:20;
  pointer-events:none;
  padding:0 16px;
}
.rawm-toast{
  background:var(--rawm-ink);
  color:#fff;
  font-size:12.5px;
  font-weight:500;
  padding:10px 16px;
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:8px;
  box-shadow:0 14px 30px -10px rgba(0,0,0,.4);
}
.rawm-toast i{ color:var(--rawm-orange); font-size:14px; }
