/* ==========================================================================
   Componente: Botões
   ========================================================================== */

/* Base para todos os botões */
.btn {
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-medium);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    display: inline-flex; /* Changed to inline-flex for better alignment */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    user-select: none;
    white-space: nowrap;
    min-height: 44px; /* Área de toque mínima recomendada para acessibilidade */
    will-change: transform, box-shadow; /* Otimização de performance para animações */
}

.btn:focus, .btn-close:focus, button:focus {
    outline: 2px solid var(--color-one) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Efeito hover suave para todos os botões */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
    z-index: 0;
}

.btn:hover::before {
    left: 100%;
}

.btn > * {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Variações de Botões
   ========================================================================== */

/* Botão principal (vermelho Netflix) */
.btn-one {
    background: linear-gradient(135deg, var(--color-one) 0%, var(--color-one-hover) 100%) !important;
    border-color: transparent !important;
    color: var(--color-three) !important;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.btn-one:hover, .btn-one:focus {
    background: linear-gradient(135deg, var(--color-one-hover) 0%, #dc0510 100%) !important;
    color: var(--color-three) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

/* Botão secundário (verde) */
.btn-two {
    background: linear-gradient(135deg, var(--color-six-one) 0%, var(--color-six-two) 100%) !important;
    border-color: transparent !important;
    color: var(--color-three) !important;
    box-shadow: 0 4px 12px rgba(70, 211, 105, 0.3);
}

.btn-two:hover, .btn-two:focus {
    background: linear-gradient(135deg, var(--color-six-two) 0%, #25a03a 100%) !important;
    color: var(--color-three) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(70, 211, 105, 0.4);
}

/* Botão laranja */
.btn-four {
    background: linear-gradient(135deg, var(--btn-four-background) 0%, var(--btn-four-hover-background) 100%) !important;
    border-color: transparent !important;
    color: var(--btn-four-color) !important;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-four:hover, .btn-four:focus {
    background: linear-gradient(135deg, var(--btn-four-hover-background) 0%, #c7491f 100%) !important;
    color: var(--btn-four-hover-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Botão azul */
.btn-five {
    background: linear-gradient(135deg, var(--btn-five-background) 0%, var(--btn-five-hover-background) 100%) !important;
    border-color: transparent !important;
    color: var(--btn-five-color) !important;
    box-shadow: 0 4px 12px rgba(15, 121, 175, 0.3);
}

.btn-five:hover, .btn-five:focus {
    background: linear-gradient(135deg, var(--btn-five-hover-background) 0%, #0a5a82 100%) !important;
    color: var(--btn-five-hover-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 121, 175, 0.4);
}

/* Botão outline */
.btn-outline-secondary {
    border: 2px solid var(--color-two-border) !important;
    color: var(--text-color) !important;
    background-color: transparent !important;
}

.btn-outline-secondary:hover {
    color: var(--text-color-hover) !important;
    background-color: var(--color-two-light) !important;
    border-color: var(--color-one) !important;
    transform: translateY(-1px);
}

/* Ícones nos botões */
.btn i {
    font-size: 0.9em;
}

/* ==========================================================================
   Tamanhos de Botões
   ========================================================================== */

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 38px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 52px;
}

/* ==========================================================================
   Responsividade para Botões
   ========================================================================== */

/* Ajustes para telas menores que 768px (Tablets e grandes smartphones) */
@media (max-width: 767px) {
    /* Botões em geral */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    /* Botões grandes */
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
}

/* Ajustes para telas muito pequenas (Smartphones) */
@media (max-width: 480px) {
    /* Botões em geral */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 44px; /* Mantém a área de toque segura */
    }

    /* Botões pequenos */
    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        min-height: 36px;
    }

    /* Botões grandes */
    .btn-lg {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
}

/* ==========================================================================
   Grupos de Botões Responsivos
   ========================================================================== */

/* Grupo de botões específico do perfil (mantido para compatibilidade) */
.buttons-perfil-group {
    padding-top: 10px;
    display: flex;
    justify-content: flex-end; /* Alinhado à direita em desktops */
    flex-wrap: wrap; /* Permite quebra de linha se não houver espaço */
    gap: 0.5rem; /* Espaçamento consistente entre botões */
    width: 100%;
}

/* Em telas menores, o grupo de botões se torna uma coluna centralizada */
@media (max-width: 767px) {
    .buttons-perfil-group {
        padding-top: 20px;
        flex-direction: column;
        justify-content: center;
        align-items: stretch; /* Faz os botões ocuparem a largura do container */
    }

    .buttons-perfil-group .btn {
        width: 100%; /* Cada botão ocupa a largura total */
        margin-bottom: 10px; /* Espaçamento vertical entre botões empilhados */
    }

    .buttons-perfil-group .btn:last-child {
        margin-bottom: 0; /* Remove o espaçamento do último botão */
    }
}

/* Classe genérica para grupos de botões responsivos (sugestão de uso) */
.btn-group-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 767px) {
    .btn-group-responsive {
        flex-direction: column;
    }

    .btn-group-responsive .btn {
        width: 100%;
    }
}
