/* Made by Federico Dionisi - IG: @fede.ddi */
/* © 2025 – Tutti i diritti riservati */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: "Questrial", sans-serif;
  background: #f0f0f0;
  overflow: hidden;
}

body, h1, h2, h3, h4, h5, h6, p, span, button, a, div, .popup-content-admin, .popup-content-admin h2,.popup-content-admin input, .popup-content-admin button, .popup-buttons-admin, .password-error {
  font-family: 'Questrial', sans-serif !important;
}

body {
  transition: filter 0.3s ease;
}

body.blurred .container {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.container {
  background: #fff;
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 0 5vw 3vw 5vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.6s ease-in-out;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  background-color: #00aff0;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.container::after {
  content: "";
  position: absolute;
  top: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  left: 0;
  width: 100%;
  height: calc(100% - (12vh + (clamp(90px, 18vw, 180px) / 2)));
  background-color: #fff;
  z-index: 0;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(12vh + (clamp(90px, 18vw, 180px) / 2));
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: url('star.png') no-repeat center center;
  background-size: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 1px white);
  opacity: 0.8;
}

.profile-pic {
  width: clamp(90px, 18vw, 180px);
  height: clamp(90px, 18vw, 180px);
  border-radius: 50%;
  object-fit: cover;
  margin: 12vh 0 4vh 0;
  border: 1mm solid white;
  position: relative;
  z-index: 1;
}

h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-bottom: 2vh;
  color: black;
  z-index: 1;
}

.name-text {
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: normal;
}

.verified-badge {
  width: 0.9em;
  height: 0.9em;
  display: inline-block;
  background-image: url('badge.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.subtitle {
  margin-bottom: 5vh;
  color: #666;
  font-size: clamp(0.7rem, 2vw, 1rem);
  z-index: 1;
}

.links {
  width: 100%;
  max-width: 400px;
  margin-top: 3vh;
  z-index: 1;
}

.btn-white {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  height: 46px;
  padding-left: 46px;
  padding-right: 40px;
  border: 2px solid #ccc;
  border-radius: 40px;
  background: #fff;
  color: #000;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: bounceIn 0.6s ease;
  gap: 10px;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.btn-text {
  display: flex;
  align-items: center;
  height: 100%;
  line-height: 1;
  font-size: 16px;
}

.btn-white::after {
  content: "›";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #000;
  font-weight: bold;
  line-height: 1;
}

.icon-lock {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.icon-lock img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-white:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-black,
.btn-blue {
  padding: clamp(10px, 2vw, 18px) clamp(15px, 4vw, 25px);
  border: none;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  border-radius: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  animation: bounceIn 0.6s ease;
  text-align: center;
  box-shadow: none;
  font-family: 'Questrial', sans-serif;
}

.btn-black {
  background: #000;
  color: white;
  font-family: 'Questrial', sans-serif;
}

.btn-blue {
  background: #00aff0;
  color: white;
  text-decoration: none;
  font-family: 'Questrial', sans-serif;
}

.btn-black:hover,
.btn-blue:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 5vw;
}

.popup-content {
  background: #fff;
  padding: 4vw;
  border-radius: 20px;
  max-width: 600px;
  min-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.4s ease;
  font-family: 'Questrial', sans-serif;
}

.popup-content h2 {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  margin-bottom: 1.2rem;
}

.popup-content p {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: #333;
  margin-bottom: 2rem;
}

.popup-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: nowrap;
}

.popup-buttons .btn-black,
.popup-buttons .btn-blue {
  flex: 1 1 48%;
  min-width: 140px;
  font-family: 'Questrial', sans-serif;
}

@media (max-width: 480px) {
  .container::before {
    height: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
  }
  .container::after {
    top: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
    height: calc(100% - (12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2));
  }
  .stars {
    height: calc(12vh + (clamp(156px, 42vw, 300px) * 1.2) / 2);
  }
  .profile-pic {
    width: calc(clamp(156px, 42vw, 300px) * 1.2);
    height: calc(clamp(156px, 42vw, 300px) * 1.2);
    margin: 12vh 0 3vh 0;
  }
  h1 .name-text {
    font-size: clamp(2.1rem, 6vw, 3rem);
    margin-top: 0.5vh;
  }
  .subtitle {
    font-size: clamp(1.05rem, 3vw, 1.5rem);
    margin-top: 0.5vh;
    margin-bottom: 4vh;
  }
  .popup-buttons {
    flex-wrap: nowrap;
    flex-direction: row;
    gap: 10px;
  }
  .popup-buttons .btn-black,
  .popup-buttons .btn-blue {
    flex: 1;
    min-width: unset;
    width: auto;
  }
}

.footer-instagram {
  position: fixed;
  bottom: 20px;
  width: 100%;
  text-align: center;
  font-family: 'Questrial', sans-serif;
  font-size: 0.75rem;
  color: #777777;
  z-index: 2147483649 !important;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.footer-copyrights {
  user-select: none;
}

.instagram-link {
  color: #777777;
  text-decoration: none;
  transition: color 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.instagram-link:hover {
  color: #00aff0;
  text-decoration: underline;
}

.instagram-text {
  text-decoration: underline;
  font-size: 12px;
}

.instagram-icon {
  font-size: 12px;
  vertical-align: middle;
  pointer-events: none;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  60% {
    opacity: 1;
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.popup-admin {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content-admin {
  background: white;
  padding: 20px;
  border-radius: 20px;
  width: 300px;
  max-width: 80%;
  box-sizing: border-box;
  text-align: center;
}

.popup-content-admin h2 {
  margin: 0 0 15px;
}

.popup-content-admin input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.password-error {
  color: red;
  margin-bottom: 10px;
  font-size: 14px;
}

.popup-buttons-admin {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-black,
.btn-blue {
  padding: clamp(10px, 2vw, 18px) clamp(15px, 4vw, 25px);
  border: none;
  border-radius: 40px;
  cursor: pointer;
}

.password-toggle {
  position: relative;
}

.password-toggle input {
  width: 100%;
  padding-right: 40px;
}

.toggle-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-67%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.toggle-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 480px) {
  .toggle-icon {
    transform: translateY(-67%);
  }
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none;
}

.sidebar {
  width: 250px;
  background: #d8d8d8;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  justify-content: space-between;
}

.sidebar-header {
  height: 70px;
  background: #00aff0;
  color: white;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-weight: bold;
  font-size: 30px;
  box-sizing: border-box;
  justify-content: flex-start;
}

.period-selector {
  margin-top: 30px;
  padding: 10px;
}

.period-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.period-selector select {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: 'Questrial', sans-serif !important;
}

.date-selector {
  margin-top: 10px;
  padding: 10px;
}

.date-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.date-selector input {
  width: 100%;
  padding: 8px;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  font-family: 'Questrial', sans-serif !important;
}

.sidebar-divider {
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  height: 1px;
  background: black;
  transform: translateY(-0.5px);
}

.sidebar-counters {
  position: absolute;
  top: calc(50% + 30px);
  left: 0;
  width: 100%;
  padding: 0 10px;
}

.sidebar-counters .counter-item {
  margin-bottom: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

.real-subcounters {
  margin-top: 10px;
  padding-left: 10px;
}

.real-subcounters .subcounter-group {
  margin-bottom: 10px;
}

.real-subcounters .subcounter-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.real-subcounters .subcounter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.dashboard-main {
  position: absolute;
  top: 50%;
  left: 350px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.dashboard-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
}

.dashboard-top-left {
  width: 600px;
  height: 600px;
}

.dashboard-top-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-left: 80px;
}

.dashboard-top-right-top,
.dashboard-top-right-bottom {
  width: 300px;
  height: 300px;
}

#cartesian-chart {
  width: 600px !important;
  height: 600px !important;
  display: block;
}

#social-pie-chart,
#nation-pie-chart {
  width: 250px !important;
  height: 250px !important;
  display: block;
}

.counter-select-style {
  width: 100%;
  padding: 3px 6px;
  font-size: 0.85rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: 'Questrial', sans-serif !important;
  background-color: white;
}

#social-toggle-container select,
#nation-toggle-container select {
  font-family: 'Questrial', sans-serif !important;
}

.settings-button {
  position: fixed;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
}

.settings-button svg {
  width: 24px;
  height: 24px;
  stroke: black;
}

#settings-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#settings-popup > div {
  background: white;
  padding: 25px 30px;
  border-radius: 16px;
  min-width: 300px;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  font-family: inherit;
}

#settings-popup h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

#settings-popup label {
  display: block;
  margin-bottom: 10px;
}

#settings-popup input[type="checkbox"] {
  margin-right: 10px;
}

#settings-popup button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#settings-popup .btn-cancel {
  background: #ccc;
}

#settings-popup .btn-confirm {
  background: #333;
  color: white;
}

.home-button {
  position: fixed;
  top: 15px;
  left: 255px;
  display: flex;
  align-items: center;
  gap: 0.1px;
  font-size: 16px;
  color: black;
  text-decoration: none;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Questrial', sans-serif;
}

.home-button svg {
  width: 24px;
  height: 24px;
  stroke: black;
}

@media (max-width: 480px) {
  .footer-instagram {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1;
  }
  .footer-instagram a,
  .footer-instagram span,
  .footer-instagram i { font-size: inherit; }
  .footer-instagram .instagram-icon { vertical-align: middle; }
}

@media (max-width: 420px) {
  .footer-instagram { font-size: 9px; gap: 3px; }
}

@media (max-width: 360px) {
  .footer-instagram { font-size: 8px; gap: 2px; }
}