/*
 * Sam (سام) brand overrides.
 *
 * This file is loaded AFTER the compiled Angular stylesheet (see index_template.html),
 * so these rules win the cascade without needing !important everywhere. The compiled
 * stylesheet's own color literals (the CoreUI/Bootstrap "primary"/"blue" theme color)
 * were already swapped from #20a8d8 to the brand red #991918 directly in
 * styles.570e83707d336deefb71.css — this file only adds shape/spacing polish on top,
 * plus a couple of touches the compiled CSS can't express as simple color literals.
 *
 * NOTE for whoever rebuilds this app from Angular source in the future: the proper home
 * for the color change is `assets/coreui/scss/_bootstrap-variables.scss` — set
 * `$blue: #991918;` there (and re-derive the rest) instead of patching compiled output.
 */

:root {
  --sam-red: #991918;
  --sam-red-dark: #6b1210;
  --sam-gray: #616160;
}

/* Softer, more modern corners on the main content containers */
.card,
.modal-content,
.form-control,
.custom-select,
.alert {
  border-radius: 10px;
}

.card {
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.card-header {
  border-radius: 10px 10px 0 0 !important;
}

/* Header / sidebar accent */
.app-header.navbar {
  border-bottom: 3px solid var(--sam-red);
}

.sidebar .nav-link.active {
  border-right: 3px solid var(--sam-red);
}

[dir="rtl"] .sidebar .nav-link.active {
  border-right: 0;
  border-left: 3px solid var(--sam-red);
}

/* The login page's background image (loginbg.jpg) is referenced directly by the Angular
 * component itself, not by a class in this stylesheet — recoloring that image file in
 * place (assets/img/loginbg.jpg) was enough to rebrand it without a guessed selector here. */

/* Warm neutral page background instead of stark white, matching the brand tint. */
body {
  background-color: #e4ccca !important;
}

/* "Redeem card" is the one account action link that isn't gated by a permission check
 * (unlike Change Service/Change Password, which are disabled server-side via auth.has()) —
 * it's always the first child of this container, so hiding it by position is safe. */
.row.actions-group > div:first-child {
  display: none !important;
}

/* Login page: no self-service password reset, and no iOS app (not published). */
a[href*="passwordRecovery"] {
  display: none !important;
}

a[href*="apps.apple.com"] {
  display: none !important;
}

.row.justify-content-center:has(a[href*="apps.apple.com"]) {
  justify-content: center !important;
}

/* Auto-renew toggle removed from the account info page entirely (its handler is also
 * neutralized in the JS — this hides the row so it isn't left as a dead/non-functional
 * control on screen). */
tr:has(p-inputswitch) {
  display: none !important;
}

/* "Real Traffic" column removed from the usage page's daily/monthly table (the chart
 * series with the same name was also removed directly in the JS). Scoped to the
 * app-data-usage component specifically — the table itself uses generic Bootstrap
 * classes shared with other pages, so this can't be a bare "table" selector. */
app-data-usage table th:nth-child(5),
app-data-usage table td:nth-child(5) {
  display: none !important;
}

/* ==========================================================================
   Motion system — a restrained, consistent set of transitions built around
   one signature gesture (scale) plus a soft ease, instead of scattered
   one-off effects. Entrance ("reveal") is driven by the small script at the
   bottom of index_template.html, which toggles .sam-reveal-in as cards
   scroll into view; everything else here is a pure hover/focus transition.
   ========================================================================== */

:root {
  --sam-ease: cubic-bezier(.16, 1, .3, 1);
  --sam-spring: cubic-bezier(.34, 1.56, .64, 1);
  --sam-dur-fast: 150ms;
  --sam-dur-base: 260ms;
  --sam-dur-slow: 500ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}

/* Scroll-reveal for cards: starts slightly down + faded, settles into place. */
.sam-reveal {
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: opacity var(--sam-dur-slow) var(--sam-ease),
              transform var(--sam-dur-slow) var(--sam-ease);
  will-change: opacity, transform;
}

.sam-reveal-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Cards: gentle lift + shadow bloom on hover, on top of the reveal-in settle. */
.card {
  transition: transform var(--sam-dur-base) var(--sam-ease),
              box-shadow var(--sam-dur-base) var(--sam-ease);
}

.card:hover {
  transform: translateY(-4px) scale(1.008);
  box-shadow: 0 14px 32px rgba(153, 25, 24, .14);
}

/* Buttons: the signature scale gesture — grows slightly on hover, snaps down
   on press for tactile feedback, with a quick recovery. */
.btn {
  transition: transform var(--sam-dur-fast) var(--sam-ease),
              box-shadow var(--sam-dur-fast) var(--sam-ease),
              filter var(--sam-dur-fast) var(--sam-ease);
}

.btn:hover {
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.05);
}

.btn:active {
  transform: scale(.96);
  transition-duration: 90ms;
}

/* Sidebar links: smooth slide/highlight instead of an instant color snap. */
.sidebar .nav-link {
  transition: background-color var(--sam-dur-base) var(--sam-ease),
              color var(--sam-dur-base) var(--sam-ease),
              border-color var(--sam-dur-base) var(--sam-ease),
              padding-left var(--sam-dur-base) var(--sam-ease);
}

.sidebar .nav-link:hover {
  padding-left: 1.25rem;
}

[dir="rtl"] .sidebar .nav-link:hover {
  padding-left: 1rem;
  padding-right: 1.25rem;
}

.sidebar .nav-link.active {
  transition: border-color var(--sam-dur-base) var(--sam-ease);
}

/* Inputs: a soft focus-in instead of an abrupt border/shadow jump. */
.form-control,
.custom-select,
.ui-inputtext {
  transition: border-color var(--sam-dur-base) var(--sam-ease),
              box-shadow var(--sam-dur-base) var(--sam-ease);
}

/* Table rows: quick highlight on hover for scannability. */
.table tbody tr {
  transition: background-color var(--sam-dur-fast) var(--sam-ease);
}

/* Status text/badges (Active/Online, etc.) settle in with the same spring
   used for buttons, so state changes read as lively rather than static. */
.badge {
  transition: transform var(--sam-dur-fast) var(--sam-spring),
              background-color var(--sam-dur-base) var(--sam-ease);
}

.badge:hover {
  transform: scale(1.06);
}
