/* ==================================
   DASHBOARD
   ================================== */

.af-dashboard {
	max-width: 960px;
	margin: 0 auto;
}

.af-dashboard--guest,
.af-dashboard--no-access {
	text-align: center;
	padding: 48px 24px;
	background: #f9fafb;
	border-radius: 12px;
}

.af-dashboard__login-btn {
	display: inline-block;
	padding: 12px 28px;
	background: #2271b1;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	margin-top: 12px;
}

/* Header / Greeting */
.af-dashboard__header {
	margin-bottom: 28px;
}

.af-dashboard__header h2 {
	font-size: 28px;
	font-weight: 700;
	margin: 0;
	color: #111;
}

/* Stats */
.af-dashboard__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 16px;
	margin-bottom: 32px;
}

.af-dashboard__stat {
	text-align: center;
	padding: 20px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
}

.af-dashboard__stat-value {
	display: block;
	font-size: 32px;
	font-weight: 700;
	color: #111;
	line-height: 1.2;
	margin-bottom: 4px;
}

.af-dashboard__stat-label {
	font-size: 13px;
	color: #666;
}

/* Sections */
.af-dashboard__section {
	margin-bottom: 32px;
}

.af-dashboard__section-title {
	font-size: 20px;
	margin: 0 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e5e7eb;
}

.af-dashboard__loading {
	text-align: center;
	padding: 24px;
	color: #999;
}

.af-dashboard__empty {
	text-align: center;
	padding: 24px;
	color: #999;
	background: #f9fafb;
	border-radius: 8px;
	margin: 0;
}

/* ==================================
   HEATMAP (GitHub-style grid)
   ================================== */

.af-heatmap {
	display: inline-grid;
	grid-template-rows: 20px repeat(7, 14px);
	gap: 3px;
	overflow-x: auto;
	padding: 4px;
}

.af-heatmap__corner {
	width: 28px;
}

.af-heatmap__month {
	font-size: 11px;
	color: #666;
	line-height: 20px;
	text-align: center;
	white-space: nowrap;
}

.af-heatmap__day-label {
	font-size: 11px;
	color: #666;
	line-height: 14px;
	text-align: right;
	padding-right: 4px;
	white-space: nowrap;
}

.af-heatmap__cell {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	transition: transform 0.1s;
	outline: 1px solid rgba(27, 31, 35, 0.04);
	outline-offset: -1px;
}

.af-heatmap__cell:hover {
	transform: scale(1.4);
}

.af-heatmap__cell--empty {
	background: transparent;
	outline: none;
}

.af-heatmap__cell--0 { background: #ebedf0; }
.af-heatmap__cell--1 { background: #9be9a8; }
.af-heatmap__cell--2 { background: #40c463; }
.af-heatmap__cell--3 { background: #216e39; }

/* ==================================
   ACTIVE CHALLENGES
   ================================== */

.af-dashboard__challenge-item {
	padding: 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-bottom: 8px;
}

.af-dashboard__challenge-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.af-dashboard__challenge-title {
	font-weight: 600;
	color: #111;
	text-decoration: none;
}

.af-dashboard__challenge-title:hover {
	color: #2271b1;
}

.af-dashboard__challenge-meta {
	font-size: 13px;
	color: #666;
}

.af-dashboard__challenge-progress {
	display: flex;
	align-items: center;
	gap: 12px;
}

.af-dashboard__challenge-bar {
	flex: 1;
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
}

.af-dashboard__challenge-fill {
	height: 100%;
	background: #16a34a;
	border-radius: 4px;
	transition: width 0.3s;
}

.af-dashboard__challenge-pct {
	font-size: 13px;
	font-weight: 600;
	color: #666;
	min-width: 40px;
	text-align: right;
}

/* ==================================
   FAVORITES
   ================================== */

.af-dashboard__favorites {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

.af-dashboard__fav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s;
}

.af-dashboard__fav-item:hover {
	border-color: #2271b1;
}

.af-dashboard__fav-thumb {
	width: 48px;
	height: 48px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
}

.af-dashboard__fav-title {
	flex: 1;
	font-weight: 500;
	font-size: 14px;
}

.af-dashboard__fav-duration {
	font-size: 12px;
	color: #666;
	background: #f5f5f5;
	padding: 2px 8px;
	border-radius: 10px;
	flex-shrink: 0;
}

/* ==================================
   RECENT COMPLETIONS
   ================================== */

.af-dashboard__recent-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	margin-bottom: 4px;
}

.af-dashboard__recent-date {
	font-size: 13px;
	color: #666;
	min-width: 90px;
	flex-shrink: 0;
}

.af-dashboard__recent-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.af-dashboard__recent-title {
	font-weight: 500;
	color: #111;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

a.af-dashboard__recent-title:hover {
	color: #2271b1;
}

.af-dashboard__recent-challenge {
	font-size: 12px;
	color: #888;
}

.af-dashboard__recent-duration {
	font-size: 12px;
	color: #666;
	background: #f5f5f5;
	padding: 2px 8px;
	border-radius: 10px;
	flex-shrink: 0;
}

/* ==================================
   NOTIFICATION PREFERENCES
   ================================== */

.af-notif-prefs {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.af-notif-prefs__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s;
}

.af-notif-prefs__item:hover {
	border-color: #c5c9d0;
}

/* Hide native checkbox */
.af-notif-prefs__checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Toggle track */
.af-notif-prefs__toggle {
	position: relative;
	width: 44px;
	height: 24px;
	background: #d1d5db;
	border-radius: 12px;
	flex-shrink: 0;
	transition: background 0.2s;
}

.af-notif-prefs__toggle::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.af-notif-prefs__checkbox:checked + .af-notif-prefs__toggle {
	background: #16a34a;
}

.af-notif-prefs__checkbox:checked + .af-notif-prefs__toggle::after {
	transform: translateX(20px);
}

.af-notif-prefs__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.af-notif-prefs__label {
	font-weight: 500;
	font-size: 14px;
	color: #111;
}

.af-notif-prefs__desc {
	font-size: 13px;
	color: #888;
}

/* Save confirmation */
.af-notif-prefs__saved {
	margin-top: 8px;
	padding: 8px 16px;
	font-size: 13px;
	color: #16a34a;
	font-weight: 500;
	text-align: center;
	opacity: 1;
	transition: opacity 0.3s;
}

.af-notif-prefs__saved--hide {
	opacity: 0;
}
