/* Estilos específicos para a página de perfil */

/* Temporizador */
.timer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #FFFFFF;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timer.warning {
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    animation: pulse 2s ease-in-out infinite;
}

.timer.danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Header da página de perfil */
.header {
    position: relative;
    padding-top: 4rem;
    margin-bottom: 2rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

/* Seção do perfil */
.profile-section {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
}

/* Container da imagem de perfil */
.profile-image-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    animation: fadeInScale 0.5s ease-out;
}

.profile-image-embed {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-purple);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, var(--primary-purple), var(--light-purple));
    transition: all 0.3s ease;
}

.profile-image-embed:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.profile-image-embed::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, 
        var(--primary-purple), 
        var(--light-purple), 
        #f093fb, 
        #f5576c
    );
    z-index: -1;
    animation: rotate 3s linear infinite;
}

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

.profile-verified-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #1DA1F2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.profile-verified-badge svg {
    width: 12px;
    height: 12px;
    fill: white;
}

/* Informações do perfil */
.profile-info {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.profile-username {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Placeholder para quando não há imagem */
.profile-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple), var(--light-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

/* Container de busca */
.search-container {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 4px;
    transition: all 0.3s ease;
    max-width: 700px;
    margin: 0 auto;
    position: relative; /* Permite posicionar os tooltips dentro do grupo */
}

.input-group:focus-within {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.username-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.username-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.check-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--light-purple) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 4px;
}

/* Tooltips interativos de tutorial */
.tutorial-pop {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(6px);
    animation: fadeInUp 0.25s ease-out;
    z-index: 1000;
    pointer-events: none;
}
.tutorial-pop::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    left: var(--tip-arrow-left, 50%);
    transform: translateX(-50%);
    top: var(--tip-arrow-top, -8px);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent rgba(139, 92, 246, 0.35) transparent;
}
.tutorial-pop-step {
    min-width: 40px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--light-purple) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tutorial-pop-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Posições específicas */
.tutorial-pop-input {
    top: calc(100% + 10px); /* Abaixo do quadro de texto */
    left: 12px;
}
.tutorial-pop-input::after {
    top: -8px;
    left: 16px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent rgba(139, 92, 246, 0.35) transparent;
}
.tutorial-pop-check {
    top: calc(100% + 10px); /* Abaixo do quadro de texto */
    right: 12px;
}
.tutorial-pop-check::after {
    top: -8px;
    right: 20px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent rgba(139, 92, 246, 0.35) transparent;
}
.action-container { position: relative; }
.tutorial-pop-confirm {
    top: calc(100% + 12px); /* abaixo do botão Confirmar */
    left: 50%;
    transform: translateX(-50%);
}
.tutorial-pop-confirm::after {
    top: -8px; /* setinha apontando para cima, para o botão */
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent rgba(139, 92, 246, 0.35) transparent;
}

/* Overrides: tornar número do passo neutro e posições controladas via JS */
.tutorial-pop-step { background: transparent !important; color: var(--text-secondary) !important; border-radius: 6px !important; }
.tutorial-pop-input, .tutorial-pop-check, .tutorial-pop-confirm { top: auto !important; left: auto !important; right: auto !important; transform: none !important; }
.platform-toggle-home { position: relative; }
.audio-controls { position: relative; }

/* Rodapé com deslocamento dos itens */
.footer-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.footer-left { justify-self: start; transform: translateX(-40%); color: var(--text-primary); }
.footer-center { justify-self: center; color: var(--text-secondary); }
.footer-right { justify-self: end; transform: translateX(40%); color: var(--text-primary); text-decoration: none; }

/* Destaques visuais ao focar etapas */
.input-group.tutorial-highlight {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.12);
}
.check-button.tutorial-highlight {
    box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.18);
}
.confirm-button.tutorial-highlight {
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.18);
}

/* Cards de Tutorial */
.tutorial-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1rem auto 2rem;
    max-width: 500px;
}

.tutorial-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

.tutorial-step {
    min-width: 44px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--light-purple) 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Container para embed de post (Curtidas) */
.post-embed-container {
    margin-top: 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.post-embed-container iframe {
    width: 100%;
    min-height: 400px;
    border: 0;
}

.check-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.check-button:active {
    transform: scale(0.95);
}

.check-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Efeito de piscar para o botão de verificação */
.check-button.pulse-effect {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
        transform: scale(1.05);
    }
}

/* Mensagem de status */
.status-message {
    margin: calc(2.5rem + 20px) 0 0; /* desce mais 10px adicionais */
    padding: 1rem;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Tema claro: contraste reforçado para mensagens e estatísticas */
body.theme-light .status-message.success { background: #dcfce7; border-color: #86efac; color: #22c55e; }
body.theme-light .status-message.error { background: #fee2e2; border-color: #fecaca; color: #7f1d1d; }
body.theme-light .profile-stats { color: #0f172a; }
body.theme-light .profile-username { color: #0f172a; }

/* Loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    animation: fadeInUp 0.3s ease-out;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Container de ação */
.action-container {
    margin-top: 3rem;
}

.confirm-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--light-purple) 100%);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

.confirm-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
}

.confirm-button:active:not(:disabled) {
    transform: translateY(0);
}

.confirm-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer */
.footer {
    margin-top: 4rem;
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toast container */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.toast.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .header {
        padding-top: 2rem;
    }
    
    .profile-section {
        padding: 0 1rem;
    }
    
    .input-group {
        max-width: 100%;
    }
    
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        max-width: none;
    }
    .tutorial-cards {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 0 1rem;
    }
}

