/*
 * iWebKit 5 — CSS Framework
 * iOS 6-style web app framework
 */

/* ==================== RESET ==================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ==================== BASE ==================== */
html {
  height: 100%;
}

body {
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  -webkit-text-size-adjust: none;
  background-color: #c5c5c5;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(255,255,255,0.03) 1px,
      rgba(255,255,255,0.03) 2px
    );
  min-height: 100%;
  overflow-x: hidden;
}

/* ==================== TOP BAR ==================== */
#topbar {
  background: linear-gradient(180deg, #6d84a2 0%, #4a6990 100%);
  border-bottom: 1px solid #2c4a6e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 6px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

#title {
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.45);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== NAV BUTTONS ==================== */
#leftnav,
#rightnav {
  min-width: 70px;
  display: flex;
  align-items: center;
}

#rightnav {
  justify-content: flex-end;
}

/* Standard nav button */
#leftnav a,
#rightnav a {
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, #7a98bc 0%, #527099 100%);
  border: 1px solid #2c4a6e;
  border-radius: 5px;
  padding: 4px 9px;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}

#leftnav a:active,
#rightnav a:active {
  background: linear-gradient(180deg, #3a5a7a 0%, #28486a 100%);
}

/* Back button with chevron arrow */
#leftnav a.back::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #fff;
  margin-right: 1px;
}

/* ==================== CONTENT AREA ==================== */
#content {
  padding: 9px 9px 20px;
  margin-top: 44px;
  min-height: calc(100vh - 44px);
}

/* ==================== GROUPED LIST ==================== */
ul {
  list-style: none;
  margin-bottom: 18px;
}

ul li.group {
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
}

/* Section header */
ul li.group span.header {
  display: block;
  color: #4d6282;
  font-size: 13px;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 7px 10px 4px;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Section footer */
ul li.group span.footer {
  display: block;
  color: #6e6e7a;
  font-size: 12px;
  text-align: center;
  padding: 6px 10px 8px;
  background: transparent;
}

/* ==================== ROW LINKS ==================== */
ul li.group a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 38px 8px 10px;
  text-decoration: none;
  color: #000;
  font-size: 16px;
  border-bottom: 1px solid #c8c7cc;
  background-color: #fff;
  position: relative;
  gap: 10px;
  transition: background-color 0.08s ease;
  cursor: pointer;
}

ul li.group a:last-of-type,
ul li.group a.last {
  border-bottom: none;
}

ul li.group a:active,
ul li.group a.active-state {
  background-color: #d9d9d9;
}

/* Disclosure arrow */
ul li.group a::after {
  content: '›';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #c7c7cc;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

/* No arrow variant */
ul li.group a.noarrow {
  padding-right: 10px;
}

ul li.group a.noarrow::after {
  display: none;
}

/* ==================== ICON IN ROW ==================== */
ul li.group a .iw-icon,
ul li.group a img.icon {
  width: 29px;
  height: 29px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Gloss shine on icon */
ul li.group a .iw-icon::after,
ul li.group a img.icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.06) 100%);
  border-radius: 7px 7px 0 0;
  pointer-events: none;
}

/* ==================== COMMENT / DETAIL TEXT ==================== */
ul li.group a span.comment {
  color: #8e8e93;
  font-size: 13px;
  margin-left: auto;
  flex-shrink: 0;
  max-width: 45%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== ROW LABEL TEXT ==================== */
ul li.group a .iw-row-title {
  font-size: 16px;
  color: #000;
}

ul li.group a .iw-row-subtitle {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 1px;
}

/* ==================== LOADING INDICATOR ==================== */
#iw-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#iw-loading .iw-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: iw-spin 0.8s linear infinite;
}

@keyframes iw-spin {
  to { transform: rotate(360deg); }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}
