/* scr.ing core styles – shared layout and structure */
:root {
  --accent: #0e76bc;

  /* Light mode colors */
  --bg-light: #f5f5f5;
  --text-light: #333;
  --card-light: #ffffff;
  --border-color: #ddd;
  --main-text: #444;

  /* Dark mode colors */
  --bg-dark: #121212;
  --text-dark: #eee;
  --card-dark: #1e1e1e;
  --border-color-dark: #444;
  --main-text-dark: #ccc;

  /* Tap-to-Copy messages */
  --taptocopy: #888;
  --copied: #4caf50;

  /* Rank Box - Light Mode */
  --rank-border-light: var(--accent);
  --rank-bg-light: transparent;
  --rank-text-light: var(--accent);
  --rank-active-border-light: var(--accent);
  --rank-active-bg-light: var(--accent);
  --rank-active-text-light: #ffffff;

  /* Rank Box - Dark Mode */
  --rank-border-dark: var(--accent);
  --rank-bg-dark: transparent;
  --rank-text-dark: var(--accent);
  --rank-active-border-dark: var(--accent);
  --rank-active-bg-dark: var(--accent);
  --rank-active-text-dark: #ffffff;

  /* Rank Hover */
  --rank-hover-border-light: var(--accent);
  --rank-hover-bg-light: #e0f0ff;
  --rank-hover-text-light: var(--accent);
  --rank-hover-border-dark: var(--accent);
  --rank-hover-bg-dark: #1c2c3c;
  --rank-hover-text-dark: var(--accent);

  /* Checkbox Accent */
  --checkbox-accent-light: var(--accent);
  --checkbox-accent-dark: var(--accent);

  /* Checkbox Hover Background */
  --checkbox-item-hover-light: #f0f8ff;
  --checkbox-item-hover-dark: #2a2a2a;

  /* List Item Checked Background */
  --item-checked-bg-light: #dff0d8;
  --item-checked-bg-dark: #2b3a2b;

  /* Divider lines */
  --divider-color-light: #ddd;
  --divider-color-dark: #444;
  
  /* Background Image Defaults */
	--background-image-light: none;
	--background-image-dark: none;
	--background-repeat: no-repeat;
	--background-size: cover;
	--background-position: center;

}

/* Light and Dark mode structure */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
}

body.light {
  background-color: var(--bg-light);
  background-image: var(--background-image-light);
  background-repeat: var(--background-repeat);
  background-size: var(--background-size);
  background-position: var(--background-position);
  background-attachment: fixed;
  color: var(--text-light);
}

body.dark {
  background-color: var(--bg-dark);
  background-image: var(--background-image-dark);
  background-repeat: var(--background-repeat);
  background-size: var(--background-size);
  background-position: var(--background-position);
  background-attachment: fixed;
  color: var(--text-dark);
}

header {
  background: var(--accent);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  box-sizing: border-box;
}
.menu {
  background-color: var(--menu-bg-light);
  color: var(--menu-text-light);
  font-weight: bold;
}

body.dark .menu {
  background-color: var(--menu-bg-dark);
  color: var(--menu-text-dark);
}
#list-subtitle {
  text-align: center;
}
#page-header {
  min-height: 60px;
}

.logo img {
  height: 40px;
}
/*
h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-top: 1rem;
  color: var(--accent);
}*/

h1 {
  text-align: center;
  font-size: 1.8rem;
  margin-top: 1rem;
  color: var(--heading-light);
}
body.dark h1 {
  color: var(--heading-dark);
}


.item-list {
  width: fit-content;
  max-width: 95%;
  margin: 0 auto;
  background: var(--card-light);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body.dark .item-list {
  background: var(--card-dark);
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.item input[type='checkbox'] {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  accent-color: var(--checkbox-accent-light);
}

body.dark .item input[type='checkbox'] {
  accent-color: var(--checkbox-accent-dark);
}

.item label {
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
  gap: 0.5rem;
  cursor: pointer;
}
.share-button {
  margin: 0.25rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  color: white;
  text-decoration: none;
  display: inline-block;
}

.facebook { background: #3b5998; }
.twitter { background: #1da1f2; }
.linkedin { background: #0077b5; }
.whatsapp { background: #25d366; }
.bluesky { background: #0e76bc; }
.instagram { background: #d62976; }

.item {
  display: flex;
  justify-content: space-between;
  margin: 0.75rem 0;
}

.item:hover {
  background-color: var(--checkbox-item-hover-light);
}

body.dark .item:hover {
  background-color: var(--checkbox-item-hover-dark);
}

.item input[type='checkbox']:checked + label {
  background-color: var(--item-checked-bg-light);
}

body.dark .item input[type='checkbox']:checked + label {
  background-color: var(--item-checked-bg-dark);
}

.score-box {
  text-align: center;
  font-size: 1.25rem;
  margin-top: 2rem;
}

.rank-box {
  background: var(--card-light);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body.dark .rank-box {
  background: var(--card-dark);
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.rank {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: bold;
  border: 2px solid var(--rank-border-light);
  background-color: var(--rank-bg-light);
  color: var(--rank-text-light);
  transition: all 0.3s ease;
}

body.dark .rank {
  border: 2px solid var(--rank-border-dark);
  background-color: var(--rank-bg-dark);
  color: var(--rank-text-dark);
}

.rank.active {
  background-color: var(--rank-active-bg-light);
  color: var(--rank-active-text-light);
  border-color: var(--rank-active-border-light);
}

body.dark .rank.active {
  background-color: var(--rank-active-bg-dark);
  color: var(--rank-active-text-dark);
  border-color: var(--rank-active-border-dark);
}

.rank:hover {
  border-color: var(--rank-hover-border-light);
  background-color: var(--rank-hover-bg-light);
  color: var(--rank-hover-text-light);
}

body.dark .rank:hover {
  border-color: var(--rank-hover-border-dark);
  background-color: var(--rank-hover-bg-dark);
  color: var(--rank-hover-text-dark);
}

.rank.active {
  cursor: pointer;
  position: relative;
}

.rank.active::after {
  content: "Tap to copy";
  position: absolute;
  top: -1.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--taptocopy);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rank.active:hover::after {
  opacity: 1;
}

.rank.active.copied::after {
  content: "Copied!";
  color: var(--copied);
  opacity: 1;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--main-text);
  border-top: 1px solid var(--border-color);
}

a {
  color: #3CB043;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body.dark a {
  color: #3CB043;
}

.center {
  text-align: center;
}

em {
  font-style: italic;
}

li em {
  white-space: normal;
  font-style: italic;
}

.list-rank-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 95%;
  margin: 0 auto;
  align-items: center;
}

@media(min-width: 768px) {
  .list-rank-container {
    flex-direction: row;
    justify-content: center;
    gap: 3rem;
  }
}
.item-list, .rank-box {
  flex: 1 1 300px;
  max-width: 500px;
}
.rank-graphic {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}
#share-buttons {
  text-align: center;
  margin-top: 2rem;
}

#share-buttons .share-button {
  display: inline-block;
}
/* Checkbox Styling for Consistency */
.item input[type="checkbox"] {
  width: 1.3em;
  height: 1.3em;
  vertical-align: middle;
  margin-right: 0.5em;
  accent-color: var(--checkbox-accent-light);
}
body.dark .item input[type="checkbox"] {
  accent-color: var(--checkbox-accent-dark);
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.item input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.3em;
  height: 1.3em;
  margin-top: 0.25em;
  accent-color: var(--checkbox-accent-light);
}

body.dark .item input[type="checkbox"] {
  accent-color: var(--checkbox-accent-dark);
}

.item label {
  flex: 1;
  line-height: 1.4;
  cursor: pointer;
}

#recommendation-header {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
}

#country-selector {
  display: inline-block;
  margin-left: 0.5rem;
}

#country-selector img {
  width: 24px;
  cursor: pointer;
  vertical-align: middle;
}
#recommendation-container {
  display: none;
  margin: 2rem 0;
}
/* Make the selector anchor point for the popup */
#country-selector {
  position: relative;
  display: inline-block;    /* ensure width hugs its contents */
}

/* The floating country menu */
.country-menu {
  position: absolute;
  top: 100%;                /* just below the flag */
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 0.5rem;
  margin: 0.25rem 0 0;      /* a little gap */
  list-style: none;
  z-index: 1000;            /* float above everything */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Each country entry */
.country-menu li {
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  color: #3CB043;
}

.country-menu li:hover {
  background: #f0f0f0;
}
#recommendation-list li {
  /* a light border to separate each item */
  border-bottom: 1px solid rgba(255,255,255,0.2);
  /* give some breathing room */
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

/* no divider under the very last item */
#recommendation-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
