/* ==========================================================================
   RS ARC Manager - Dedicated Reader Experience Portal Styles
   BookSirens-Style Modern Luxury UI & Interactive Components
   ========================================================================== */

:root {
	--rs-primary: #4f46e5;
	--rs-primary-hover: #4338ca;
	--rs-primary-light: #e0e7ff;
	--rs-slate-900: #0f172a;
	--rs-slate-800: #1e293b;
	--rs-slate-700: #334155;
	--rs-slate-600: #475569;
	--rs-slate-500: #64748b;
	--rs-slate-400: #94a3b8;
	--rs-slate-200: #e2e8f0;
	--rs-slate-100: #f1f5f9;
	--rs-slate-50: #f8fafc;
	--rs-white: #ffffff;
	--rs-radius-lg: 16px;
	--rs-radius-md: 10px;
	--rs-radius-sm: 6px;
	--rs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--rs-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
	--rs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.rs-arc-reader-dashboard {
	max-width: 1180px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: var(--rs-slate-800);
	line-height: 1.5;
	box-sizing: border-box;
}

.rs-arc-reader-dashboard * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Anti-Ghosting Frozen Notice Banner
   -------------------------------------------------------------------------- */
.rs-arc-freeze-banner {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-left: 5px solid #ef4444;
	border-radius: var(--rs-radius-md);
	padding: 18px 22px;
	margin-bottom: 24px;
	box-shadow: var(--rs-shadow-sm);
	animation: rsPortalFadeIn 0.3s ease;
}

.rs-arc-freeze-banner .freeze-icon {
	font-size: 28px;
	line-height: 1;
	flex-shrink: 0;
}

.rs-arc-freeze-banner .freeze-details h4 {
	margin: 0 0 4px 0;
	color: #991b1b;
	font-size: 16px;
	font-weight: 700;
}

.rs-arc-freeze-banner .freeze-details p {
	margin: 0 0 6px 0;
	color: #b91c1c;
	font-size: 14px;
	line-height: 1.5;
}

.rs-arc-freeze-banner .freeze-action-hint {
	color: #7f1d1d;
	font-weight: 600;
	font-size: 13px;
	margin: 0;
}

/* --------------------------------------------------------------------------
   Header Bar / Profile & Capacity Ribbon
   -------------------------------------------------------------------------- */
.rs-arc-reader-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-lg);
	padding: 24px 30px;
	margin-bottom: 24px;
	box-shadow: var(--rs-shadow-md);
	flex-wrap: wrap;
	gap: 24px;
}

.reader-profile-col {
	display: flex;
	align-items: center;
	gap: 18px;
	flex: 1;
	min-width: 300px;
}

.reader-avatar img {
	border-radius: 50%;
	border: 3px solid var(--rs-slate-200);
	display: block;
	width: 58px;
	height: 58px;
	object-fit: cover;
	box-shadow: var(--rs-shadow-sm);
}

.reader-meta {
	flex: 1;
}

.reader-tier-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 4px;
}

.reader-tier-row h2 {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	color: var(--rs-slate-900);
	letter-spacing: -0.3px;
}

.rs-arc-tier-pill {
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 9999px;
	letter-spacing: 0.3px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rs-arc-standing-pill {
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 9999px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.standing-good {
	background: #dcfce7;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.standing-frozen {
	background: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.reader-sub {
	margin: 0;
	color: var(--rs-slate-500);
	font-size: 13px;
}

/* Active Capacity Meter Box */
.reader-capacity-col {
	min-width: 280px;
	flex-shrink: 0;
}

.capacity-stat-box {
	background: var(--rs-slate-50);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-md);
	padding: 16px 20px;
}

.capacity-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 13px;
	color: var(--rs-slate-700);
	margin-bottom: 8px;
}

.capacity-header span {
	font-weight: 600;
	color: var(--rs-slate-600);
}

.capacity-header strong {
	font-size: 14px;
	color: var(--rs-slate-900);
}

.capacity-bar-wrap {
	width: 100%;
	height: 10px;
	background: var(--rs-slate-200);
	border-radius: 9999px;
	overflow: hidden;
}

.capacity-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
	border-radius: 9999px;
	transition: width 0.4s ease;
}

.tier-advance-hint {
	display: block;
	font-size: 12px;
	color: var(--rs-slate-500);
	margin-top: 8px;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Metrics Ribbon / Quick Stats
   -------------------------------------------------------------------------- */
.rs-arc-metrics-ribbon {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 28px;
}

.rs-arc-metric-item {
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-md);
	padding: 18px 20px;
	text-align: center;
	box-shadow: var(--rs-shadow-sm);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

.rs-arc-metric-item:hover {
	transform: translateY(-2px);
	box-shadow: var(--rs-shadow-md);
}

.rs-arc-metric-item .metric-val {
	font-size: 26px;
	font-weight: 800;
	color: var(--rs-slate-900);
	line-height: 1.2;
}

.rs-arc-metric-item .metric-label {
	font-size: 13px;
	color: var(--rs-slate-500);
	margin-top: 6px;
	font-weight: 600;
	letter-spacing: -0.1px;
}

.rs-arc-metric-item.metric-highlight {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.rs-arc-metric-item.metric-highlight .metric-val,
.rs-arc-metric-item.metric-highlight .metric-label {
	color: #ffffff;
}

/* --------------------------------------------------------------------------
   Tab Navigation & Segmented Controls
   -------------------------------------------------------------------------- */
.rs-arc-tab-nav {
	display: flex;
	gap: 10px;
	border-bottom: 2px solid var(--rs-slate-200);
	margin-bottom: 24px;
	padding-bottom: 0;
	overflow-x: auto;
}

.rs-arc-tab-btn {
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 12px 22px;
	font-size: 15px;
	font-weight: 600;
	color: var(--rs-slate-500);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: -2px;
	transition: all 0.2s ease;
	white-space: nowrap;
	border-radius: 6px 6px 0 0;
	outline: none;
}

.rs-arc-tab-btn:hover {
	color: var(--rs-slate-800);
	background: rgba(241, 245, 249, 0.6);
}

.rs-arc-tab-btn.active {
	color: var(--rs-primary);
	border-bottom-color: var(--rs-primary);
	background: transparent;
	font-weight: 700;
}

.tab-badge {
	background: var(--rs-slate-200);
	color: var(--rs-slate-700);
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 9999px;
	line-height: 1.2;
}

.rs-arc-tab-btn.active .tab-badge {
	background: var(--rs-primary-light);
	color: var(--rs-primary);
}

/* Tab Content Visibility */
.rs-arc-tab-content {
	display: none !important;
}

.rs-arc-tab-content.active {
	display: block !important;
	animation: rsPortalFadeIn 0.25s ease;
}

@keyframes rsPortalFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --------------------------------------------------------------------------
   TAB 1: Active ARCs Cards
   -------------------------------------------------------------------------- */
.active-arcs-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.active-arc-card {
	display: flex;
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-lg);
	padding: 22px;
	box-shadow: var(--rs-shadow-sm);
	gap: 22px;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.active-arc-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--rs-shadow-md);
	border-color: #cbd5e1;
}

.arc-card-cover {
	width: 125px;
	flex-shrink: 0;
}

.arc-card-cover img {
	width: 100%;
	height: 175px;
	object-fit: cover;
	border-radius: var(--rs-radius-md);
	box-shadow: 0 4px 8px -1px rgba(0, 0, 0, 0.12);
	display: block;
}

.cover-placeholder {
	width: 100%;
	height: 175px;
	background: var(--rs-slate-100);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 38px;
	border-radius: var(--rs-radius-md);
	border: 1px dashed var(--rs-slate-300);
}

.arc-card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.arc-card-header-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	flex-wrap: wrap;
	gap: 8px;
}

/* Countdown Badges */
.countdown-badge {
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cd-normal {
	background: #e0f2fe;
	color: #0369a1;
	border: 1px solid #bae6fd;
}

.cd-warning {
	background: #fef3c7;
	color: #b45309;
	border: 1px solid #fde68a;
}

.cd-urgent {
	background: #ffedd5;
	color: #c2410c;
	border: 1px solid #fed7aa;
	animation: pulse-urgent 2s infinite;
}

.cd-overdue {
	background: #fee2e2;
	color: #b91c1c;
	font-weight: 800;
	border: 1px solid #fca5a5;
}

@keyframes pulse-urgent {
	0% { opacity: 1; }
	50% { opacity: 0.8; }
	100% { opacity: 1; }
}

.genre-tag {
	font-size: 12px;
	color: var(--rs-slate-600);
	background: var(--rs-slate-100);
	padding: 3px 10px;
	border-radius: 9999px;
	font-weight: 600;
}

.arc-book-title {
	margin: 0 0 4px 0;
	font-size: 19px;
	font-weight: 700;
	color: var(--rs-slate-900);
	letter-spacing: -0.2px;
}

.arc-book-author {
	margin: 0 0 12px 0;
	color: var(--rs-slate-600);
	font-size: 14px;
}

.arc-meta-details {
	display: flex;
	gap: 20px;
	font-size: 13px;
	color: var(--rs-slate-500);
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.arc-download-buttons {
	display: flex;
	gap: 10px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.btn-download {
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	border-radius: var(--rs-radius-sm);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s ease;
}

.btn-epub {
	background: #eff6ff;
	color: #1d4ed8 !important;
	border: 1px solid #bfdbfe;
}

.btn-epub:hover {
	background: #dbeafe;
	border-color: #93c5fd;
	transform: translateY(-1px);
}

.btn-pdf {
	background: #fef2f2;
	color: #b91c1c !important;
	border: 1px solid #fecaca;
}

.btn-pdf:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	transform: translateY(-1px);
}

.arc-review-cta-wrap {
	display: flex;
	justify-content: flex-end;
	margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Action Buttons (Luxury SaaS Styling)
   -------------------------------------------------------------------------- */
.rs-arc-btn-action {
	background: var(--rs-primary);
	color: #ffffff !important;
	border: none;
	padding: 10px 20px;
	border-radius: var(--rs-radius-sm);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s ease;
	text-decoration: none;
	box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.rs-arc-btn-action:hover {
	background: var(--rs-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
}

.rs-arc-btn-secondary {
	background: var(--rs-slate-100);
	color: var(--rs-slate-700) !important;
	border: 1px solid var(--rs-slate-300);
	padding: 10px 18px;
	border-radius: var(--rs-radius-sm);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.rs-arc-btn-secondary:hover {
	background: var(--rs-slate-200);
}

.rs-arc-btn-sm {
	padding: 6px 14px;
	font-size: 13px;
}

/* --------------------------------------------------------------------------
   TAB 2: Completed Reviews Table
   -------------------------------------------------------------------------- */
.rs-arc-campaigns-table-container {
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-md);
	overflow: hidden;
	box-shadow: var(--rs-shadow-sm);
}

.rs-arc-author-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.rs-arc-author-table th {
	background: var(--rs-slate-50);
	color: var(--rs-slate-600);
	font-weight: 600;
	text-align: left;
	padding: 14px 18px;
	border-bottom: 1px solid var(--rs-slate-200);
}

.rs-arc-author-table td {
	padding: 14px 18px;
	border-bottom: 1px solid var(--rs-slate-100);
	vertical-align: middle;
}

.rs-arc-author-table tr:last-child td {
	border-bottom: none;
}

.rs-arc-author-table tr:hover td {
	background: var(--rs-slate-50);
}

.rs-arc-link-pill {
	display: inline-block;
	background: #eff6ff;
	color: #1d4ed8;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 4px;
	text-decoration: none;
	margin-right: 4px;
	border: 1px solid #bfdbfe;
}

.rs-arc-link-pill:hover {
	background: #dbeafe;
}

.rs-arc-status-pill {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.rs-arc-status-pill.status-active {
	background: #dcfce7;
	color: #15803d;
}

/* --------------------------------------------------------------------------
   TAB 3: Browse Open ARCs Grid
   -------------------------------------------------------------------------- */
.browse-header-banner {
	margin-bottom: 20px;
	background: var(--rs-white);
	padding: 18px 22px;
	border-radius: var(--rs-radius-md);
	border: 1px solid var(--rs-slate-200);
	box-shadow: var(--rs-shadow-sm);
}

.browse-header-banner h3 {
	margin: 0 0 6px 0;
	font-size: 18px;
	color: var(--rs-slate-900);
	font-weight: 700;
}

.browse-header-banner p {
	margin: 0;
	font-size: 14px;
	color: var(--rs-slate-500);
}

.browse-arcs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.browse-arc-card {
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-md);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: var(--rs-shadow-sm);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.browse-arc-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--rs-shadow-md);
}

.browse-card-cover img {
	width: 100%;
	height: 170px;
	object-fit: cover;
	display: block;
}

.browse-card-info {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.browse-card-info h4 {
	margin: 6px 0 2px 0;
	font-size: 16px;
	color: var(--rs-slate-900);
	font-weight: 700;
}

.author-line {
	margin: 0 0 10px 0;
	color: var(--rs-slate-500);
	font-size: 13px;
}

.seats-left-pill {
	display: inline-block;
	background: #f0fdf4;
	color: #166534;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 9999px;
	margin-bottom: 12px;
	border: 1px solid #bbf7d0;
	width: fit-content;
}

.browse-actions {
	margin-top: auto;
}

/* --------------------------------------------------------------------------
   Empty States
   -------------------------------------------------------------------------- */
.rs-arc-empty-state {
	text-align: center;
	padding: 48px 24px;
	background: var(--rs-white);
	border: 1px solid var(--rs-slate-200);
	border-radius: var(--rs-radius-lg);
	box-shadow: var(--rs-shadow-sm);
}

.rs-arc-empty-state .empty-icon {
	font-size: 48px;
	margin-bottom: 14px;
	line-height: 1;
}

.rs-arc-empty-state h3 {
	margin: 0 0 8px 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--rs-slate-900);
}

.rs-arc-empty-state p {
	margin: 0 auto 20px auto;
	max-width: 480px;
	color: var(--rs-slate-500);
	font-size: 14px;
	line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Portal Review Submission Modal
   -------------------------------------------------------------------------- */
.rs-arc-portal-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.portal-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
}

.portal-modal-dialog {
	position: relative;
	background: var(--rs-white);
	border-radius: var(--rs-radius-lg);
	max-width: 560px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: var(--rs-shadow-lg);
	z-index: 2;
	animation: rsModalScaleIn 0.2s ease;
}

@keyframes rsModalScaleIn {
	from {
		opacity: 0;
		transform: scale(0.96);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.portal-modal-header {
	padding: 20px 26px;
	border-bottom: 1px solid var(--rs-slate-200);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.portal-modal-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--rs-slate-900);
}

.portal-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--rs-slate-400);
	cursor: pointer;
	padding: 0;
	line-height: 1;
}

.portal-modal-close:hover {
	color: var(--rs-slate-800);
}

.portal-modal-body {
	padding: 24px 26px;
}

.portal-modal-body .form-group {
	margin-bottom: 18px;
}

.portal-modal-body label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--rs-slate-700);
	margin-bottom: 6px;
}

.portal-modal-body .form-control {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--rs-slate-300);
	border-radius: var(--rs-radius-sm);
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.portal-modal-body .form-control:focus {
	border-color: var(--rs-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.portal-modal-body small {
	display: block;
	font-size: 12px;
	color: var(--rs-slate-500);
	margin-top: 4px;
}

.portal-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Responsive Layout
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.rs-arc-metrics-ribbon {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.rs-arc-reader-header {
		flex-direction: column;
		align-items: stretch;
		padding: 20px;
	}

	.reader-profile-col {
		min-width: 100%;
	}

	.reader-capacity-col {
		width: 100%;
		min-width: 100%;
	}

	.active-arc-card {
		flex-direction: column;
	}

	.arc-card-cover {
		width: 100%;
	}

	.arc-card-cover img {
		height: 220px;
	}

	.arc-review-cta-wrap {
		justify-content: stretch;
	}

	.arc-review-cta-wrap button {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 480px) {
	.rs-arc-metrics-ribbon {
		grid-template-columns: 1fr;
	}
}
