/* Edit Mode Styles */
.edit-mode {
  border: 2px dashed var(--accent);
  border-radius: 20px;
  position: relative;
}

.edit-mode .profile-header::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
}

.edit-toggle {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: 55px !important;
  height: 55px !important;
  border-radius: 50% !important;
  background: var(--gradient, linear-gradient(135deg, #6a11cb, #2575fc)) !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
  z-index: 9999999 !important; /* Valor extremamente alto para garantir que fique por cima de tudo */
  transition: all 0.3s ease !important;
  font-size: 16px !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: pulse-effect 2s infinite; /* Adiciona animação para chamar atenção */
}

@keyframes pulse-effect {
  0% {
    box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(106, 17, 203, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(106, 17, 203, 0);
  }
}

.edit-toggle:hover {
  transform: scale(1.15) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
  background: linear-gradient(135deg, #8e24aa, #3949ab) !important;
}

.edit-toggle i {
  font-size: 22px !important;
  color: white !important;
}

.edit-controls {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  padding: 15px 20px;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 998;
  display: grid;
  grid-template-columns: 1fr;
  transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: white;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3);
  max-height: 60vh;
  overflow-y: auto;
}

.edit-controls.active {
  bottom: 0;
}

.edit-action-buttons {
  display: flex !important;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.save-button, .cancel-button {
  padding: 12px !important;
  width: 45px !important;
  height: 45px !important;
  border-radius: 50% !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
}

.save-button {
  background-color: rgba(0, 180, 80, 0.85);
  color: white;
}

.save-button:hover {
  background-color: rgba(0, 200, 100, 1);
  transform: scale(1.1);
}

.cancel-button {
  background-color: rgba(150, 150, 150, 0.85);
  color: white;
}

.cancel-button:hover {
  background-color: rgba(180, 180, 180, 1);
  transform: scale(1.1);
}

/* Editable Fields */
.edit-input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3);
}

.username-input {
  font-size: 24px;
  text-align: center;
  font-weight: 700;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  padding: 5px;
  max-width: 80%;
  margin: 0 auto 5px;
}

.bio-input {
  width: 90%;
  margin: 0 auto;
  display: block;
  height: 100px;
  resize: none;
  font-size: 16px;
  line-height: 1.5;
}

.description-input {
  width: 90%;
  margin: 15px auto;
  display: block;
  height: 150px;
  resize: none;
  font-size: 15px;
  line-height: 1.5;
}

.phone-input {
  display: inline-block;
  width: auto;
  margin-left: 5px;
}

/* Social links editing */
.social-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 18px;
  border-radius: 12px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  position: relative;
  width: 100%;
  max-width: 450px;
}

.social-edit-wrapper .social-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.15);
  padding: 10px;
  border-radius: 8px;
}

.social-edit-wrapper .social-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.social-edit-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.social-url-input {
  flex-grow: 1;
  margin-bottom: 8px;
  width: 100%;
}

.remove-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255,0,0,0.2);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.remove-btn:hover {
  background-color: rgba(255,0,0,0.6);
  transform: scale(1.1);
}

.platform-select {
  width: 120px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.add-social-btn {
  width: 100%;
  max-width: 200px;
  height: 40px;
  border-radius: 10px;
  background-color: rgba(0, 255, 0, 0.2);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 auto;
  font-weight: 600;
}

.add-social-btn:hover {
  background-color: rgba(0, 255, 0, 0.4);
  transform: scale(1.1);
}

/* Profile link editing */
.link-edit-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.link-edit-wrapper .icon-preview {
  align-self: center;
  margin-bottom: 5px;
  font-size: 1.5em;
}

.link-edit-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon-preview {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.link-title-input {
  flex: 2;
  margin-bottom: 0;
}

.link-url-input {
  flex: 3;
  margin-bottom: 0;
}

.icon-select, .class-select {
  flex: 1;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.add-link-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background-color: rgba(0, 255, 0, 0.2);
  border: none;
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-link-btn:hover {
  background-color: rgba(0, 255, 0, 0.4);
}

/* Upload image button */
.img-edit-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.upload-img-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  border: 2px solid white;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.upload-img-btn:hover {
  background-color: var(--accent);
}

/* Status message */
.message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 15px 25px;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.message.show {
  transform: translateX(-50%) translateY(0);
}

.message.success {
  background-color: rgba(0, 160, 70, 0.9);
}

.message.error {
  background-color: rgba(200, 0, 0, 0.9);
}

/* Footer items editing */
.edit-footer-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.edit-footer-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.footer-text-input {
  flex: 2;
  margin-bottom: 0;
}

.footer-url-input {
  flex: 2;
  margin-bottom: 0;
}

.footer-icon-select {
  width: 120px;
  padding: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  margin-bottom: 0;
}

.footer-brand-checkbox {
  margin-right: 5px;
}

.footer-brand-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: white;
}

.add-footer-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background-color: rgba(0, 255, 0, 0.2);
  border: none;
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.add-footer-btn:hover {
  background-color: rgba(0, 255, 0, 0.4);
}

/* Tema editor */
.theme-editor {
  position: fixed;
  top: 20px;
  right: 20px;
  width: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-width: 250px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(calc(100% + 20px));
  transition: transform 0.3s ease;
}

.theme-editor.active {
  transform: translateX(0);
}

.theme-toggle-btn {
  position: absolute;
  left: -40px;
  top: 0;
  width: 35px;
  height: 35px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-editor h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
  text-align: center;
}

.theme-select-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.theme-option {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-option:hover {
  transform: scale(1.1);
}

.theme-option.active {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Pattern editor - Seletor de padrões animados */
.pattern-editor {
  position: fixed;
  top: 20px;
  left: 20px;
  width: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-width: 300px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(calc(-100% - 20px));
  transition: transform 0.3s ease;
}

.pattern-editor.active {
  transform: translateX(0);
}

.pattern-toggle-btn {
  position: absolute;
  right: -40px;
  top: 0;
  width: 35px;
  height: 35px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-editor h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #fff;
  text-align: center;
}

.pattern-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pattern-option {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  color: white;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.pattern-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.2;
  z-index: -1;
  transition: all 0.3s ease;
}

.pattern-option:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.pattern-option.active {
  border-color: var(--accent, #3498db);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.pattern-option span {
  position: relative;
  z-index: 1;
}

/* Estilos de previsualização para cada padrão */
.pattern-option[data-pattern="particles"]::before { 
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0) 70%);
  animation: pulse 3s infinite alternate;
}

.pattern-option[data-pattern="wave"]::before { 
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.1) 75%, transparent 75%, transparent);
  background-size: 20px 20px;
  animation: move 2s linear infinite;
}

.pattern-option[data-pattern="pulse"]::before { 
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0) 70%);
  animation: pulse 3s infinite alternate;
}

.pattern-option[data-pattern="geometric"]::before { 
  background-image: 
    linear-gradient(45deg, transparent 0%, transparent 45%, rgba(255,255,255,0.15) 45%, rgba(255,255,255,0.15) 55%, transparent 55%, transparent 100%),
    linear-gradient(135deg, transparent 0%, transparent 45%, rgba(255,255,255,0.15) 45%, rgba(255,255,255,0.15) 55%, transparent 55%, transparent 100%);
  background-size: 20px 20px;
  animation: rotate 10s linear infinite;
}

.pattern-option[data-pattern="bubbles"]::before { 
  background: radial-gradient(circle at 50% 100%, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0) 60%);
  animation: rise 4s ease-in infinite;
}

.pattern-option[data-pattern="grid"]::before { 
  background-image: 
    linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 10px 10px;
  animation: move 5s linear infinite;
}

.pattern-option[data-pattern="starfield"]::before { 
  background-image: radial-gradient(circle at 10% 20%, rgba(255,255,255,0.8) 1px, transparent 1px),
                    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.6) 1px, transparent 1px),
                    radial-gradient(circle at 50% 60%, rgba(255,255,255,0.4) 1px, transparent 1px);
  animation: twinkle 3s ease-in-out infinite alternate;
}

.pattern-option[data-pattern="noise"]::before { 
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.25"/></svg>');
  animation: shift 5s steps(10) infinite;
}

.pattern-option[data-pattern="lines"]::before { 
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(255,255,255,0.1) 5px,
    rgba(255,255,255,0.1) 10px
  );
  animation: move 15s linear infinite;
}

.pattern-option[data-pattern="ripple"]::before { 
  background: radial-gradient(circle, rgba(255,255,255,0.2) 10%, transparent 10.5%, transparent 20%, rgba(255,255,255,0.2) 20.5%, transparent 30%);
  background-size: 100px 100px;
  animation: pulse 4s ease-in-out infinite;
}

/* Animações para previsualização */
@keyframes move {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes rise {
  0% { transform: translateY(100%) scale(0.8); opacity: 0.5; }
  100% { transform: translateY(0%) scale(1.2); opacity: 0; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

@keyframes shift {
  0% { background-position: 0 0; }
  100% { background-position: 10px 10px; }
}

/* Tema options previews */
.theme-option.theme-1 { background: var(--gradient-1); }
.theme-option.theme-2 { background: var(--gradient-2); }
.theme-option.theme-3 { background: var(--gradient-3); }
.theme-option.theme-4 { background: var(--gradient-4); }
.theme-option.theme-5 { background: var(--gradient-5); }
.theme-option.theme-6 { background: var(--gradient-6); }
.theme-option.theme-7 { background: var(--gradient-7); }
.theme-option.theme-8 { background: var(--gradient-8); }
.theme-option.theme-9 { background: var(--gradient-9); }
.theme-option.theme-10 { background: var(--gradient-10); }
.theme-option.theme-11 { background: var(--gradient-11); }
.theme-option.theme-12 { background: var(--gradient-12); }
.theme-option.theme-13 { background: var(--gradient-13); }
.theme-option.theme-14 { background: var(--gradient-14); }
.theme-option.theme-15 { background: var(--gradient-15); }

/* Responsive */
@media (max-width: 768px) {
  .theme-select-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .link-edit-wrapper {
    grid-template-columns: 1fr;
  }
  
  .social-edit-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    width: 100%;
  }
  
  .edit-footer-wrapper {
    grid-template-columns: 1fr;
  }
  
  .icon-preview {
    margin: 0 auto;
  }
  
  .edit-controls {
    max-height: 75vh;
  }
}

@media (max-width: 480px) {
  .edit-action-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .save-button, .cancel-button {
    width: 100%;
  }
}