:root {
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  transition: background-color 0.3s ease;
}

body.dark {
  background-color: #0a0a0a;
  color: #f2f2f7;
}

.card-container {
  width: 320px;
  height: 560px;
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

.card.flip {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  gap: 20px;
  color: #111;
  backface-visibility: hidden;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark .card-face {
  background: rgba(28, 28, 30, 0.7);
  color: #f2f2f7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border: none;
}

.card-face>* {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-back {
  transform: rotateY(180deg);
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  gap: 20px;
}

.profile {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.name {
  font-size: 22px;
  font-weight: 600;
  color: #333;
}

.socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.socials a {
  background: rgba(255, 255, 255, 0.5);
  color: #111;
  border-radius: 16px;
  padding: 14px 0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.socials a:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.05);
}

body.dark .socials a {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f2f7;
}

body.dark .socials a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.socials i {
  font-size: 18px;
  margin-bottom: 6px;
}

.qr {
  margin-top: 10px;
  margin-bottom: 10px;
}

.qr img {
  margin-top: 40px;
  width: 150px;
  height: 150px;
}

.qr-code {
  border-radius: 16px;
  background-color: white;
  padding: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: inline-block;
}


.flip-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.4);
  color: #111;
  border: none;
  border-radius: 16px;
  width: 48px;
  height: 48px;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, transform 0.2s ease;
}

.flip-btn:hover {
  transform: scale(1.1);
}

.card.flip .flip-btn i {
  transform: rotate(180deg);
}

body.dark .flip-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.theme-toggle {
  margin-top: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.03);
  padding: 8px 16px;
  border-radius: 30px;
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.dark .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
}

.theme-toggle .sun i,
.theme-toggle .moon i {
  color: #666;
  transition: color 0.3s ease;
}

body.dark .theme-toggle .sun i,
body.dark .theme-toggle .moon i {
  color: #ccc;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #c7c7cc;
  transition: 0.4s;
  border-radius: 30px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked+.slider {
  background-color: #b3b3b3;
  /* suave cinza, Apple-like */
}

input:checked+.slider:before {
  transform: translateX(22px);
}

/* Nova animação para o botão de flip */
.flip-btn i {
  transition: transform 0.6s ease;
}

.card.flip .flip-btn i {
  transform: rotate(180deg);
}

/* Melhorando legibilidade no modo escuro */

body.dark .name {
  color: #f2f2f7;
}

body.dark .card-back div[style*="text-align: center"] {
  color: #f2f2f7 !important;
  background: rgba(28, 28, 30, 0.6) !important;
}

body.dark .card-back a {
  color: #f2f2f7 !important;
  background: rgba(255, 255, 255, 0.15);
}

body.dark .card-back p {
  color: #f2f2f7 !important;
}

.card-face.card-front {
  justify-content: space-between;
  padding-top: 40px;
  padding-bottom: 32px;
}

.profile {
  margin-top: 16px;
  margin-bottom: 12px;
}

.name {
  margin-bottom: 12px;
  font-size: 20px;
}

.socials {
  margin-top: auto;
  padding-bottom: 12px;
  width: 100%;
}

.card-face.card-back {
  justify-content: flex-start;
  padding-top: 40px;
  padding-bottom: 32px;
  gap: 24px;
}

.card-back .qr {
  margin-top: 10px;
  margin-bottom: 10px;
}

.card-back div[style*="text-align: center"] {
  margin-bottom: 10px;
  line-height: 1.5;
}

.card-back a {
  margin-top: auto;
}

/* Card com fundo branco sólido e sombra discreta */
.card-face {
  background: #fff;
  color: #000;
  border-radius: 28px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border: none;
  box-sizing: border-box;
}

body.dark .card-face {
  background: #1c1c1e;
  color: #f2f2f7;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* Centralizando elementos como na Apple */
.card-face.card-front,
.card-face.card-back {
  padding: 24px;
  /* gap: 20px; */
  justify-content: flex-start;
  /* padding-bottom: 24px; */
}

/* Espaço acima da imagem */
.profile {
  margin-top: 40px;
  margin-bottom: 16px;
}

/* Tamanho do nome mais proporcional */
.name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Espaçamento dos botões sociais */
.socials {
  margin-top: auto;
  padding-bottom: 8px;
}

/* Reduzindo ícones sociais para aparência mais clean */
.socials a {
  padding: 10px 0;
  font-size: 12px;
  font-weight: 500;
  border-radius: 14px;
}

/* Botão flip mais sutil */
.flip-btn {
  background: rgba(0, 0, 0, 0.05);
}

body.dark .flip-btn {
  background: rgba(255, 255, 255, 0.15);
}

.share-btn {
  color: #111;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.share-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

body.dark .share-btn {
  color: #f2f2f7;
  background: rgba(255, 255, 255, 0.1);
}

body.dark .share-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.dark .title {
  color: #bbb !important;
}

.skill-pill {
  background: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
}

body.dark .skill-pill {
  background: rgba(255, 255, 255, 0.1);
}

.card-back>div:last-child {
  margin-top: auto;
}

.socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 16px;
  justify-items: center;
}

@media (max-width: 600px) {
  .socials {
    grid-template-columns: repeat(2, 1fr);
  }
}

.social-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 50px;
  height: 30px;
  border-radius: 16px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #000;
  border: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
}

.icon-btn:hover {
  transform: scale(1.05);
  background-color: #e0e0e0;
}

body.dark .icon-btn {
  background-color: #1a1a1a;
  color: #fff;
}

body.dark .icon-btn:hover {
  background-color: #333;
}

.icon-label {
  font-size: 12px;
  color: inherit;
  text-align: center;
  font-weight: 500;
}

.icon-btn i {
  transform: translateY(3px);
  font-size: 25px;
}

.name {
  margin-bottom: 4px;
  margin-top: -8px;
}

.title {
  margin-top: -12px;
  margin-bottom: 8px;
}

.socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 16px;
  justify-items: center;
  padding: 0 16px;
}

.socials {
  margin: 0 auto;
}

.socials {
  display: grid;
  grid-template-columns: repeat(4, 64px);
  gap: 16px 8px;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  margin-top: 10px;
}