/**
 * GuiStock App — Client PWA Dashboard Styles
 *
 * Post-auth screens: dashboard, orders, order detail, rating, support, profile.
 * Bottom navigation bar for mobile-first PWA experience.
 *
 * @package GuiStock_Hub
 * @since   3.4.0
 */

/* ─── Override layout for post-auth screens ─────────── */
.gs-app__screen .gs-app-dash {
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	padding: 20px 16px 100px;
	min-height: 100vh;
	box-sizing: border-box;
}

/* Post-auth screens use top-aligned layout, not centered. */
#gs-app-dashboard.gs-app__screen--active,
#gs-app-orders.gs-app__screen--active,
#gs-app-order.gs-app__screen--active,
#gs-app-rate.gs-app__screen--active,
#gs-app-support.gs-app__screen--active,
#gs-app-profile.gs-app__screen--active {
	align-items: flex-start;
	justify-content: flex-start;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* ─── Dashboard Header ──────────────────────────────── */
.gs-app-dash__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
	padding-top: 8px;
}

.gs-app-dash__greeting {
	font-size: 22px;
	font-weight: 700;
	color: #042A2D;
	margin: 0;
	line-height: 1.3;
}

.gs-app-dash__sub {
	font-size: 13px;
	color: #6b7280;
	margin: 2px 0 0;
}

.gs-app-dash__logout {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #fff;
	cursor: pointer;
	color: #6b7280;
	transition: all .2s ease;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app-dash__logout svg {
	pointer-events: none;
}
.gs-app-dash__logout:hover {
	color: #ef4444;
	border-color: #fecaca;
	background: #fef2f2;
}

.gs-app-dash__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	background: #fff;
	cursor: pointer;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	transition: all .2s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app-dash__back:hover {
	background: #f9fafb;
}

/* ─── Stat Cards ────────────────────────────────────── */
.gs-app-dash__stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-bottom: 24px;
}

.gs-app-dash__stat {
	background: #fff;
	border-radius: 14px;
	padding: 16px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
	border: 1px solid #f3f4f6;
	transition: transform .15s ease;
}
.gs-app-dash__stat:active {
	transform: scale(0.97);
}

.gs-app-dash__stat-val {
	font-size: 28px;
	font-weight: 800;
	color: #042A2D;
	line-height: 1.1;
}

.gs-app-dash__stat-label {
	font-size: 11px;
	font-weight: 600;
	color: #6b7280;
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.gs-app-dash__stat--success .gs-app-dash__stat-val { color: #059669; }
.gs-app-dash__stat--warning .gs-app-dash__stat-val { color: #d97706; }
.gs-app-dash__stat--info .gs-app-dash__stat-val { color: #019297; }

/* ─── Section Title ─────────────────────────────────── */
.gs-app-dash__section-title {
	font-size: 15px;
	font-weight: 700;
	color: #374151;
	margin: 0 0 12px;
}

/* ─── Order List ────────────────────────────────────── */
.gs-app-dash__order-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gs-app-dash__order-card {
	display: block;
	background: #fff;
	border-radius: 12px;
	padding: 14px 16px;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	border: 1px solid #f3f4f6;
	transition: all .15s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app-dash__order-card:hover,
.gs-app-dash__order-card:active {
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	border-color: #e5e7eb;
}

.gs-app-dash__order-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.gs-app-dash__order-tracking {
	font-size: 13px;
	font-weight: 700;
	color: #042A2D;
	font-family: 'SFMono-Regular', 'Consolas', monospace;
}

.gs-app-dash__order-status {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
}
.gs-app-dash__order-status--success { background: #d1fae5; color: #065f46; }
.gs-app-dash__order-status--warning { background: #fef3c7; color: #92400e; }
.gs-app-dash__order-status--danger  { background: #fee2e2; color: #991b1b; }
.gs-app-dash__order-status--info    { background: #e0f4f5; color: #017578; }
.gs-app-dash__order-status--muted   { background: #f3f4f6; color: #6b7280; }

.gs-app-dash__order-mid {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
	color: #374151;
	margin-bottom: 6px;
}

.gs-app-dash__order-addr {
	font-size: 12px;
	color: #9ca3af;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gs-app-dash__order-bot {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.gs-app-dash__order-amount {
	font-size: 13px;
	font-weight: 700;
	color: #019297;
}

.gs-app-dash__order-date {
	font-size: 11px;
	color: #9ca3af;
}

/* ─── See All Link ──────────────────────────────────── */
.gs-app-dash__see-all {
	display: block;
	text-align: center;
	margin-top: 12px;
	font-size: 13px;
	font-weight: 600;
	color: #019297;
	text-decoration: none;
	padding: 10px;
}
.gs-app-dash__see-all:hover { text-decoration: underline; }

/* ─── Loading & Empty ───────────────────────────────── */
.gs-app-dash__loading,
.gs-app-dash__empty {
	text-align: center;
	padding: 32px 16px;
	font-size: 13px;
	color: #9ca3af;
}

.gs-app-dash__loading::before {
	content: '';
	display: block;
	width: 28px;
	height: 28px;
	border: 3px solid #e5e7eb;
	border-top-color: #019297;
	border-radius: 50%;
	animation: gs-spin .6s linear infinite;
	margin: 0 auto 10px;
}

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

/* ─── Filters Bar ───────────────────────────────────── */
.gs-app-dash__filters {
	display: flex;
	gap: 6px;
	margin-bottom: 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-bottom: 4px;
}
.gs-app-dash__filters::-webkit-scrollbar { display: none; }

.gs-app-dash__filter {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border-radius: 20px;
	border: 1px solid #e5e7eb;
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	cursor: pointer;
	white-space: nowrap;
	transition: all .15s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app-dash__filter--active,
.gs-app-dash__filter:active {
	background: #042A2D;
	color: #fff;
	border-color: #042A2D;
}

/* ─── Pagination ────────────────────────────────────── */
.gs-app-dash__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 16px;
	font-size: 13px;
	color: #6b7280;
}

.gs-app-dash__page-btn {
	padding: 8px 14px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	transition: all .15s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app-dash__page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.gs-app-dash__page-btn:not(:disabled):hover {
	background: #f9fafb;
}

/* ─── Order Detail ──────────────────────────────────── */
.gs-app-dash__order-detail {
	width: 100%;
}

.gs-app-detail__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.gs-app-detail__tracking {
	font-size: 18px;
	font-weight: 800;
	color: #042A2D;
	margin: 0;
	font-family: 'SFMono-Regular', 'Consolas', monospace;
}

.gs-app-detail__info {
	background: #fff;
	border-radius: 14px;
	padding: 16px;
	margin-bottom: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	border: 1px solid #f3f4f6;
}

.gs-app-detail__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 13px;
}
.gs-app-detail__row:last-child { border-bottom: none; }
.gs-app-detail__row span:first-child { color: #6b7280; }
.gs-app-detail__row strong { color: #042A2D; font-weight: 600; text-align: right; max-width: 60%; }

.gs-app-detail__subtitle {
	font-size: 14px;
	font-weight: 700;
	color: #374151;
	margin: 20px 0 10px;
}

/* Items */
.gs-app-detail__items {
	background: #fff;
	border-radius: 12px;
	padding: 4px 16px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	border: 1px solid #f3f4f6;
}
.gs-app-detail__item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 13px;
	color: #374151;
}
.gs-app-detail__item:last-child { border-bottom: none; }

/* Timeline */
.gs-app-detail__timeline {
	padding-left: 12px;
	border-left: 2px solid #e5e7eb;
	margin-left: 6px;
}

.gs-app-detail__timeline-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding-bottom: 16px;
	position: relative;
}
.gs-app-detail__timeline-item:last-child { padding-bottom: 0; }

.gs-app-detail__timeline-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #019297;
	flex-shrink: 0;
	margin-top: 4px;
	margin-left: -17px;
	border: 2px solid #fff;
}

.gs-app-detail__timeline-content {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.gs-app-detail__timeline-action {
	font-size: 13px;
	font-weight: 500;
	color: #374151;
}

.gs-app-detail__timeline-date {
	font-size: 11px;
	color: #9ca3af;
}

/* POD Image */
.gs-app-detail__pod {
	width: 100%;
	border-radius: 12px;
	margin-top: 8px;
	border: 1px solid #f3f4f6;
}

/* Rating display */
.gs-app-detail__rating {
	background: #fef3c7;
	border-radius: 12px;
	padding: 14px 16px;
	margin-top: 16px;
	text-align: center;
}

.gs-app-detail__star {
	font-size: 20px;
	color: #d1d5db;
	margin: 0 1px;
}
.gs-app-detail__star--active { color: #f59e0b; }

.gs-app-detail__rating-comment {
	font-size: 12px;
	color: #92400e;
	margin: 6px 0 0;
	font-style: italic;
}

.gs-app-detail__rate-btn {
	margin-top: 16px;
	width: 100%;
	text-align: center;
}

/* ─── Star Rating Form ──────────────────────────────── */
.gs-app-dash__stars {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 20px 0;
}

.gs-app-dash__star {
	font-size: 36px;
	color: #d1d5db;
	background: none;
	border: none;
	cursor: pointer;
	transition: color .15s ease, transform .1s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	line-height: 1;
	padding: 4px;
}
.gs-app-dash__star:active { transform: scale(1.2); }
.gs-app-dash__star--active { color: #f59e0b; }

.gs-app-dash__rate-form,
.gs-app-dash__support-form,
.gs-app-dash__profile-form {
	width: 100%;
}

/* ─── Bottom Navigation ─────────────────────────────── */
.gs-app__nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	height: 64px;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	z-index: 50;
	padding-bottom: env(safe-area-inset-bottom, 0);
	box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.gs-app__nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	flex: 1;
	text-decoration: none;
	color: #9ca3af;
	font-size: 10px;
	font-weight: 600;
	transition: color .15s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.gs-app__nav-item svg {
	pointer-events: none;
	transition: color .15s ease;
}
.gs-app__nav-item span {
	pointer-events: none;
}

.gs-app__nav-item--active {
	color: #019297;
}
.gs-app__nav-item--active svg {
	stroke: #019297;
}

/* ─── DARK MODE (v3.4.0) ────────────────────────────── */
[data-theme="dark"] .gs-app-dash__greeting { color: #f4f4f5; }
[data-theme="dark"] .gs-app-dash__sub { color: #a1a1aa; }
[data-theme="dark"] .gs-app-dash__logout {
	background: #1e1e34;
	border-color: #3d3d54;
	color: #a1a1aa;
}
[data-theme="dark"] .gs-app-dash__logout:hover {
	color: #f87171;
	border-color: #5c2020;
	background: #2e1a1a;
}

[data-theme="dark"] .gs-app-dash__back {
	background: #1e1e34;
	border-color: #3d3d54;
	color: #d1d5db;
}

[data-theme="dark"] .gs-app-dash__stat {
	background: #1e1e34;
	border-color: #2d2d44;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .gs-app-dash__stat-val { color: #f4f4f5; }
[data-theme="dark"] .gs-app-dash__stat-label { color: #a1a1aa; }
[data-theme="dark"] .gs-app-dash__stat--success .gs-app-dash__stat-val { color: #4ade80; }
[data-theme="dark"] .gs-app-dash__stat--warning .gs-app-dash__stat-val { color: #fbbf24; }
[data-theme="dark"] .gs-app-dash__stat--info .gs-app-dash__stat-val { color: #01b5ba; }

[data-theme="dark"] .gs-app-dash__section-title { color: #d1d5db; }

[data-theme="dark"] .gs-app-dash__order-card {
	background: #1e1e34;
	border-color: #2d2d44;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .gs-app-dash__order-tracking { color: #f4f4f5; }
[data-theme="dark"] .gs-app-dash__order-mid { color: #d1d5db; }
[data-theme="dark"] .gs-app-dash__order-addr { color: #6b7280; }
[data-theme="dark"] .gs-app-dash__order-amount { color: #01b5ba; }
[data-theme="dark"] .gs-app-dash__order-date { color: #6b7280; }

[data-theme="dark"] .gs-app-dash__order-status--success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .gs-app-dash__order-status--warning { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .gs-app-dash__order-status--danger  { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .gs-app-dash__order-status--info    { background: #134e4a; color: #5eead4; }
[data-theme="dark"] .gs-app-dash__order-status--muted   { background: #2d2d44; color: #9ca3af; }

[data-theme="dark"] .gs-app-dash__see-all { color: #01b5ba; }

[data-theme="dark"] .gs-app-dash__filter {
	background: #1e1e34;
	border-color: #3d3d54;
	color: #a1a1aa;
}
[data-theme="dark"] .gs-app-dash__filter--active {
	background: #01b5ba;
	color: #042A2D;
	border-color: #01b5ba;
}

[data-theme="dark"] .gs-app-dash__page-btn {
	background: #1e1e34;
	border-color: #3d3d54;
	color: #d1d5db;
}

[data-theme="dark"] .gs-app-detail__info {
	background: #1e1e34;
	border-color: #2d2d44;
}
[data-theme="dark"] .gs-app-detail__row { border-color: #2d2d44; }
[data-theme="dark"] .gs-app-detail__row span:first-child { color: #a1a1aa; }
[data-theme="dark"] .gs-app-detail__row strong { color: #f4f4f5; }
[data-theme="dark"] .gs-app-detail__tracking { color: #f4f4f5; }
[data-theme="dark"] .gs-app-detail__subtitle { color: #d1d5db; }

[data-theme="dark"] .gs-app-detail__items {
	background: #1e1e34;
	border-color: #2d2d44;
}
[data-theme="dark"] .gs-app-detail__item { border-color: #2d2d44; color: #d1d5db; }

[data-theme="dark"] .gs-app-detail__timeline { border-color: #3d3d54; }
[data-theme="dark"] .gs-app-detail__timeline-dot { border-color: #1e1e34; }
[data-theme="dark"] .gs-app-detail__timeline-action { color: #d1d5db; }
[data-theme="dark"] .gs-app-detail__timeline-date { color: #6b7280; }

[data-theme="dark"] .gs-app-detail__rating { background: #2e2a1a; }
[data-theme="dark"] .gs-app-detail__rating-comment { color: #fcd34d; }

[data-theme="dark"] .gs-app-dash__star { color: #3d3d54; }
[data-theme="dark"] .gs-app-dash__star--active { color: #f59e0b; }

[data-theme="dark"] .gs-app__nav {
	background: #16162a;
	border-top-color: #2d2d44;
	box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
[data-theme="dark"] .gs-app__nav-item { color: #6b7280; }
[data-theme="dark"] .gs-app__nav-item--active { color: #01b5ba; }

[data-theme="dark"] .gs-app-dash__loading,
[data-theme="dark"] .gs-app-dash__empty { color: #6b7280; }
[data-theme="dark"] .gs-app-dash__loading::before { border-color: #3d3d54; border-top-color: #01b5ba; }
