/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Basic layout */
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
	color: #fff;
	background-color: #0b0b0b; /* near black fallback */
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;

	position: relative;
}

/* Dark overlay to improve readability over the background image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(3,3,3,0.55) 0%, rgba(3,3,3,0.35) 45%, rgba(3,3,3,0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure main structural regions render above the overlay */
header.site-header,
.flash-wrapper,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* On small screens, avoid background-attachment:fixed (mobile performance and UX) */
@media (max-width: 768px) {
  body::before { background: rgba(3,3,3,0.7); }
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.flash {
	padding: 0.5rem 1rem;
	margin: 0.5rem 1rem;
	border-radius: 4px;
}
.flash.notice { background: linear-gradient(90deg, rgba(204,52,45,0.12), rgba(255,255,255,0.02)); color: #ffdede; border: 1px solid rgba(204,52,45,0.15) }
.flash.alert { background: #3a0f0d; color: #ffd9d6; border: 1px solid rgba(204,52,45,0.2) }

table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1rem;
}

th, td {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid #eee;
}

td img { border-radius: 6px; }

form button, input[type="submit"] {
	background: #0366d6;
	color: white;
	border: none;
	padding: 0.4rem 0.6rem;
	border-radius: 4px;
	cursor: pointer;
}

form button:hover { background: #0256b5 }

.pagination {
	display: flex;
	gap: 0.5rem;
	list-style: none;
	padding: 0;
	margin-top: 1rem;
}

.pagination a, .pagination span { padding: 0.4rem 0.6rem; border: 1px solid rgba(255,255,255,0.03); border-radius: 4px; color: #ddd }

/* Header and footer */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
}
.site-brand { display:flex; align-items:center; gap:0.75rem }
.site-title { font-weight:700; color:var(--ruby-white) }
.site-nav { display:flex; align-items:center; gap:0.75rem }
.inline-form { display:inline }
.btn-ruby.small { padding: 0.4rem 0.7rem; font-size:0.9rem }

.site-main { flex: 1; padding: 2rem 1.25rem; display: flex; flex-direction: column }
.site-main > .hero { flex: 1 }

.site-footer { border-top: 1px solid rgba(255,255,255,0.02); padding: 1.5rem 1.25rem; margin-top: 0; }
.footer-inner { max-width: 1100px; margin: 0 auto; display:flex; gap:1rem; align-items:center; justify-content:space-between; flex-wrap:wrap }
.footer-brand { display:flex; align-items:center; gap:0.6rem; color:#cfcfcf }
.footer-links a { color:#9fa0a3; margin: 0 0.5rem; text-decoration: none }
.footer-links a:hover { color: var(--ruby-white) }
.footer-copy { color:#8a8a8a; width:100%; text-align:center; margin-top:0.8rem }

/* links */
a { color: #ffb6b3 }
a:visited { color: #ff8b86 }
a:hover { color: var(--ruby-white); text-decoration: underline }

/* ensure contrast for visited/active states */
a:focus, a:active { outline: 2px solid rgba(204,52,45,0.25); outline-offset: 2px }

/* Pagination list items */
.pagination { display:flex; gap:0.5rem; align-items:center }
.pagination span, .pagination a { display:inline-block; padding: 0.35rem 0.6rem; border-radius:4px; }
.pagination .page { color: #ddd }
.pagination .page.current { background: var(--ruby-red); color: var(--ruby-white); font-weight:600 }
.pagination .prev, .pagination .next, .pagination .first, .pagination .last { color:#ccc }
.pagination .prev a, .pagination .next a, .pagination .first a, .pagination .last a { color:#ffdede }
.pagination .gap { color:#666 }


/* Ruby-themed dark styles */
:root {
	--ruby-red: #cc342d;
	--ruby-dark: #0b0b0b;
	--ruby-gray: #111216;
	--ruby-white: #ffffff;
}

.hero {
	min-height: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-left: 10%;
}

.card {
	max-width: 400px;
	width: 100%;
	padding: 2.5rem 2rem;
	text-align: left;
}

.card h1 { font-size: 2.75rem; line-height: 1.1; margin-bottom: 1rem; }
.card .btn-ruby { width: 100%; justify-content: center; margin-top: 1.5rem; }

@media (max-width: 768px) {
	.hero { justify-content: center; padding-left: 0; }
	.card { padding: 2rem 1.25rem; text-align: center; }
}

.card h1 {
	margin: 0 0 0.25rem 0;
	color: var(--ruby-white);
}

.card p.lead { color: #d6d6d6; margin-bottom: 1.25rem }

.btn-ruby {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	background: linear-gradient(180deg, var(--ruby-red), #b72a25);
	color: var(--ruby-white);
	padding: 0.85rem 1.4rem;
	border-radius: 999px;
	font-weight: 600;
	border: none;
	text-decoration: none;
}

.btn-ruby:hover { filter: brightness(0.95) }

.footer-note {
	margin-top: 2rem;
	text-align: left;
	color: #8a8a8a;
	font-size: 0.9rem;
}

.logo-small { height: 20px; vertical-align: middle }
.logo-xl { height: 64px; vertical-align: middle }
.logo-large { height: 48px; vertical-align: middle }


.btn-ruby { cursor: pointer; font-size: 1rem; font-family: inherit }
.card .inline-form, .card .btn-ruby { width: 100% }
.signin-action { margin-top: 1.5rem }
.signin-action .btn-ruby { margin-top: 0 }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap }
.page-header .inline-form, .page-header .btn-ruby { width: auto }

.spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite }
.btn-ruby.loading { opacity: 0.8; cursor: progress }
.btn-ruby.loading .spinner { display: inline-block }
.btn-ruby.loading svg { display: none }
@keyframes spin { to { transform: rotate(360deg) } }

.skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.16) 37%, rgba(255,255,255,0.06) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50% }
.skeleton-text { flex: 1; height: 18px; max-width: 320px }
.skeleton-btn { width: 90px; height: 32px; margin-left: auto; border-radius: 999px }
@keyframes shimmer { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* Animated ruby lights (pure CSS), adapted from https://codepen.io/sylvaingarnot/pen/OJqoXaR */
.ruby-lights { position: fixed; inset: 0; overflow: hidden; z-index: -1; background: #0b0b0b; pointer-events: none }
.ruby-lights .light {
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 100vh;
	transform: rotate(10deg);
	transform-origin: top right;
	box-shadow:
		-130px 0 80px 40px #0b0b0b,
		-50px 0 50px 25px var(--c1),
		0 0 50px 25px var(--c2),
		50px 0 50px 25px var(--c3),
		130px 0 80px 40px #0b0b0b;
	animation: ruby-slide var(--duration) linear infinite;
	animation-delay: var(--delay);
	will-change: translate;
}
.ruby-lights .mask-h { position: absolute; bottom: 0; left: 0; width: 100vw; height: 0; box-shadow: 0 0 50vh 40vh #0b0b0b }
.ruby-lights .mask-v { position: absolute; bottom: 0; left: 0; width: 0; height: 100vh; box-shadow: 0 0 35vw 25vw #0b0b0b }
@keyframes ruby-slide {
	from { translate: 25vw 0 }
	to { translate: -125vw 0 }
}
@media (prefers-reduced-motion: reduce) {
	.ruby-lights .light { animation: none; translate: -40vw 0 }
}


/* Frosted glass panels (navbar and login card) */
.card {
	background: linear-gradient(135deg, rgb(0, 0, 0), rgba(255,255,255,0.015));
	border: 1px solid rgba(255,255,255,0.18);
	border-top-color: rgba(255,255,255,0.3);
	border-left-color: rgba(255,255,255,0.3);
	box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
	backdrop-filter: blur(12px) saturate(150%);
	-webkit-backdrop-filter: blur(12px) saturate(150%);
}
.site-header { margin: 1rem 1.25rem 0; border-radius: 16px }
.card { border-radius: 24px }
.card .footer-note { color: #bdbdbd }
@supports not (backdrop-filter: blur(1px)) {
	.site-header, .card { background: rgba(30,12,12,0.85) }
}

/* Drop shadow under the sign in / sign out buttons */
.btn-ruby {
	box-shadow: 0 6px 16px rgba(204, 52, 45, 0.45), 0 2px 4px rgba(0, 0, 0, 0.5);
	transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
.btn-ruby:hover { box-shadow: 0 8px 22px rgba(204, 52, 45, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5); transform: translateY(-1px) }
.btn-ruby:active { box-shadow: 0 3px 8px rgba(204, 52, 45, 0.4); transform: translateY(0) }
.btn-ruby.loading { box-shadow: 0 3px 8px rgba(204, 52, 45, 0.3) }

/* Each unfollower row is its own frosted glass pane */
.glass-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem }
.glass-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1.25rem;
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015));
	border: 1px solid rgba(255,255,255,0.18);
	border-top-color: rgba(255,255,255,0.3);
	border-left-color: rgba(255,255,255,0.3);
	box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
	backdrop-filter: blur(12px) saturate(150%);
	-webkit-backdrop-filter: blur(12px) saturate(150%);
}
.glass-row img { border-radius: 50%; flex-shrink: 0 }
.glass-row-name { flex: 1; font-weight: 600; color: var(--ruby-white); text-decoration: none }
.glass-row-name:hover { text-decoration: underline }
.glass-row .inline-form, .glass-row form { margin: 0 }
@supports not (backdrop-filter: blur(1px)) {
	.glass-row { background: rgba(30,12,12,0.85) }
}

/* Pagination as a frosted glass pill */
nav.pagination {
	width: fit-content;
	margin: 1.5rem auto 0;
	padding: 0.4rem 0.6rem;
	border-radius: 999px;
	justify-content: center;
	background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015));
	border: 1px solid rgba(255,255,255,0.18);
	box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
	backdrop-filter: blur(12px) saturate(150%);
	-webkit-backdrop-filter: blur(12px) saturate(150%);
}
nav.pagination a, nav.pagination span { border-color: transparent; border-radius: 999px; text-decoration: none }
nav.pagination .page a:hover, nav.pagination .prev a:hover, nav.pagination .next a:hover,
nav.pagination .first a:hover, nav.pagination .last a:hover { background: rgba(255,255,255,0.12) }
nav.pagination .page.current { box-shadow: 0 4px 12px rgba(204, 52, 45, 0.45) }

/* Language toggle (EN | PT) */
.locale-toggle {
	display: inline-flex;
	align-items: center;
	padding: 3px;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	color: #cfcfcf;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.2);
	box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.locale-toggle span { padding: 0.3rem 0.65rem; border-radius: 999px; transition: background 0.2s ease, color 0.2s ease }
.locale-toggle span.active { background: linear-gradient(180deg, var(--ruby-red), #b72a25); color: var(--ruby-white); box-shadow: 0 2px 8px rgba(204, 52, 45, 0.5) }
.locale-toggle:hover { background: rgba(255,255,255,0.1) }
.locale-toggle { position: relative }
.locale-toggle .spinner { position: absolute; top: 50%; left: 50%; margin: -8px 0 0 -8px; padding: 0 }
.locale-toggle.loading { cursor: progress }
.locale-toggle.loading span:not(.spinner) { opacity: 0.35 }
.locale-toggle.loading .spinner { display: inline-block }

/* Readable user greeting over the animated lights */
.signed-in {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 2px 8px rgba(0,0,0,0.8), 0 0 18px rgba(0,0,0,0.7);
}
.signed-in strong { text-shadow: 0 1px 2px rgba(0,0,0,0.95), 0 2px 10px rgba(0,0,0,0.9), 0 0 22px rgba(0,0,0,0.8) }

/* Static pages (terms, privacy, contact) */
.legal {
  box-sizing: border-box;
  width: min(760px, 100%);
  margin: 2rem auto;
  padding: 2rem 2.25rem;
  color: #e6e6e6;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015));
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.legal h1 { margin: 0 0 0.25rem; color: #fff }
.legal h2 { margin: 1.5rem 0 0.35rem; font-size: 1.1rem; color: var(--ruby-white, #fff) }
.legal p { line-height: 1.6; margin: 0 0 0.5rem; overflow-wrap: anywhere }
.legal-updated { color: #9fa0a3; font-size: 0.9rem }
.legal .btn-ruby { display: inline-block; margin: 1rem 0.5rem 0 0; text-decoration: none }

/* Mobile */
@media (max-width: 600px) {
  .site-header { padding: 0.75rem 0.9rem }
  .site-brand { gap: 0.5rem; min-width: 0 }
  .site-nav { gap: 0.5rem }
  .signed-in { display: none }
  .site-nav .btn-ruby { padding: 0.5rem 0.65rem }
  .site-nav .btn-ruby .btn-label { display: none }
  .site-nav .btn-ruby.loading { min-width: 2.4rem; justify-content: center }
  .site-main { padding: 1rem 0.9rem }
  .legal { padding: 1.25rem 1.1rem; margin: 1rem auto }

  .site-footer { padding: 1.25rem 0.9rem }
  .footer-inner { flex-direction: column; text-align: center; gap: 0.75rem }
  .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1rem }
  .footer-links a { margin: 0 }
  .footer-copy { margin-top: 0.25rem; font-size: 0.85rem }
}
