/* Gerador de Nomes Roblox - Estilos Front-end */

/* Container principal - respeita o container pai da página (article) */
.rgen-container {
    width: 100%;
    max-width: 100%;
    padding: 20px 40px;
    font-family: inherit;
    box-sizing: border-box;
    display: block;
    position: relative;
    margin: 0;
    clear: both;
    float: none;
    left: auto;
    right: auto;
    transform: none;
    overflow: visible;
}

/* Garantir que elementos filhos não ultrapassem o container */
.rgen-container * {
    box-sizing: border-box;
    max-width: 100%;
}

/* Garantir que elementos com largura fixa não ultrapassem */
.rgen-container img,
.rgen-container svg {
    max-width: 100%;
    height: auto;
}

/* Em telas médias */
@media (min-width: 768px) and (max-width: 1199px) {
    .rgen-container {
        padding: 20px 30px;
    }
}

/* Em telas menores */
@media (max-width: 767px) {
    .rgen-container {
        padding: 15px 10px;
    }
}

/* Garantir que o container não ultrapasse o article */
article .rgen-container,
#article .rgen-container,
[class*="article"] .rgen-container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(10px, 3vw, 40px);
    padding-right: clamp(10px, 3vw, 40px);
}

.rgen-noscript {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

.rgen-header {
    text-align: left;
    margin-bottom: 30px;
    width: 100%;
}

.rgen-title {
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: bold;
}

.rgen-description-container {
    display: flex;
    align-items: flex-start;
    margin-top: 15px;
    margin-bottom: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.rgen-description-line {
    width: 4px;
    background-color: #dc3545;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 100%;
}

.rgen-description-content {
    flex: 1;
    padding: 15px 20px;
}

.rgen-description-content .rgen-description,
.rgen-description {
    color: inherit;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0 !important;
    margin-bottom: 0 !important;
}

/* Wrapper da caixa de nomes com botões ao lado */
.rgen-name-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.rgen-controls-top {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Botões de ícone ao lado da caixa */
.rgen-controls-side {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-shrink: 0;
}

.rgen-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Botões de ícone - quadrados */
.rgen-btn-icon {
    width: 96px;
    height: 96px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.rgen-btn-icon .rgen-icon {
    width: 48px;
    height: 48px;
    display: block;
}

.rgen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rgen-btn-primary {
    background-color: #00a859;
    color: white;
}

.rgen-btn-primary:hover:not(:disabled) {
    background-color: #008a4a;
}

.rgen-btn-primary:hover:not(:disabled) .rgen-icon {
    animation: rgen-rotate 0.6s ease-in-out;
}

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

.rgen-btn-secondary {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #e0e0e0;
}

.rgen-btn-secondary:hover:not(:disabled) {
    background-color: #000000;
}

.rgen-btn-secondary .rgen-icon {
    filter: brightness(0) saturate(100%);
}

.rgen-btn-secondary:hover:not(:disabled) .rgen-icon {
    filter: brightness(0) saturate(100%) invert(100%);
}

.rgen-btn-primary .rgen-icon {
    /* Ícone já está branco no SVG, não precisa de filter */
}

.rgen-current-name {
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    word-break: break-word;
}

.rgen-placeholder {
    color: #999;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Botão gerar menor dentro da caixa */
.rgen-generate-small {
    width: 64px;
    height: 64px;
}

.rgen-generate-small .rgen-icon {
    width: 32px;
    height: 32px;
}

.rgen-generate-small:hover .rgen-icon {
    animation: rgen-rotate 0.6s ease-in-out;
}

.rgen-settings {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rgen-settings-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
    align-items: stretch;
}

.rgen-additional-settings-full {
    width: 100%;
    margin-top: 0;
}

.rgen-settings-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rgen-settings-column .rgen-setting-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rgen-setting-group {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.rgen-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.rgen-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.rgen-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: #ddd;
}

.rgen-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00a859;
    cursor: pointer;
}

.rgen-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00a859;
    cursor: pointer;
    border: none;
}

.rgen-slider-value {
    font-weight: bold;
    font-size: 1.2em;
    min-width: 40px;
    text-align: center;
}

.rgen-gender-header,
.rgen-include-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

.rgen-additional-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 25px;
}

.rgen-input-inline {
    flex: 1;
    max-width: 600px;
    min-width: 200px;
    width: 100%;
}

.rgen-label-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rgen-label {
    margin: 0;
    display: flex;
    align-items: center;
}

.rgen-help-icon {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #000;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.rgen-help-icon:hover,
.rgen-help-icon:focus {
    background: #000;
    color: white;
    outline: none;
}

.rgen-help-icon:hover .rgen-help-question,
.rgen-help-icon:focus .rgen-help-question {
    color: white;
}

.rgen-help-question {
    line-height: 1;
}

.rgen-help-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: white;
    padding: 15px;
    border-radius: 8px;
    width: 300px;
    max-width: calc(100vw - 40px);
    font-size: 0.9em;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
}

.rgen-help-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #000;
}

.rgen-help-icon:hover .rgen-help-tooltip,
.rgen-help-icon:focus .rgen-help-tooltip {
    opacity: 1;
    visibility: visible;
}

.rgen-gender-options {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    align-items: center;
}

.rgen-gender-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    width: 50px;
    height: 50px;
}

.rgen-gender-option:hover {
    border-color: #999;
    transform: scale(1.05);
}

.rgen-gender-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rgen-gender-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* Cores dos ícones de gênero */
.rgen-gender-masculino .rgen-gender-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(98%) saturate(7499%) hue-rotate(210deg) brightness(95%) contrast(101%);
}

.rgen-gender-masculino input[type="radio"]:checked ~ .rgen-gender-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(98%) saturate(7499%) hue-rotate(210deg) brightness(95%) contrast(101%);
}

.rgen-gender-masculino input[type="radio"]:checked {
    border-color: #0066cc;
}

.rgen-gender-geral .rgen-gender-icon {
    filter: brightness(0) saturate(100%);
}

.rgen-gender-geral input[type="radio"]:checked ~ .rgen-gender-icon {
    filter: brightness(0) saturate(100%);
}

.rgen-gender-geral input[type="radio"]:checked {
    border-color: #000;
}

.rgen-gender-feminino .rgen-gender-icon {
    filter: brightness(0) saturate(100%) invert(70%) sepia(100%) saturate(500%) hue-rotate(280deg) brightness(110%) contrast(120%);
}

.rgen-gender-feminino input[type="radio"]:checked ~ .rgen-gender-icon {
    filter: brightness(0) saturate(100%) invert(70%) sepia(100%) saturate(500%) hue-rotate(280deg) brightness(110%) contrast(120%);
}

.rgen-gender-feminino input[type="radio"]:checked {
    border-color: #ff69b4;
}

/* Borda colorida quando selecionado */
.rgen-gender-masculino.rgen-gender-selected {
    border-color: #0066cc !important;
    border-width: 3px;
}

.rgen-gender-geral.rgen-gender-selected {
    border-color: #000 !important;
    border-width: 3px;
}

.rgen-gender-feminino.rgen-gender-selected {
    border-color: #ff69b4 !important;
    border-width: 3px;
}

.rgen-gender-masculino input[type="radio"]:checked {
    border-color: #0066cc;
}

.rgen-gender-geral input[type="radio"]:checked {
    border-color: #000;
}

.rgen-gender-feminino input[type="radio"]:checked {
    border-color: #ff69b4;
}

.rgen-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.rgen-input-small {
    width: 100%;
    margin-bottom: 10px;
}

.rgen-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.rgen-checkboxes-inline {
    flex-direction: row;
    margin-top: 0;
    gap: 30px;
    flex-wrap: nowrap;
    align-items: center;
}

.rgen-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.rgen-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #000000;
}

/* Estilizar checkboxes marcados com fundo preto */
input[type="checkbox"].rgen-checkbox:checked {
    background-color: #000000 !important;
    border-color: #000000 !important;
    accent-color: #000000;
}

/* Para navegadores modernos que suportam accent-color */
input[type="checkbox"].rgen-checkbox {
    accent-color: #000000;
}

.rgen-styles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.rgen-personalize {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.rgen-results {
    margin-top: 30px;
    display: grid;
    gap: 15px;
}

.rgen-result-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: all 0.3s ease;
}

.rgen-result-item:hover {
    border-color: #00a859;
    box-shadow: 0 2px 8px rgba(0, 168, 89, 0.2);
}

.rgen-result-name {
    font-size: 1.2em;
    font-weight: bold;
    flex: 1;
}

.rgen-result-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.rgen-result-status.disponivel {
    background: #d4edda;
    color: #155724;
}

.rgen-result-status.ocupado {
    background: #f8d7da;
    color: #721c24;
}

.rgen-result-status.desconhecido {
    background: #fff3cd;
    color: #856404;
}

.rgen-result-actions {
    display: flex;
    gap: 10px;
}

.rgen-btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

.rgen-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #00a859;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.rgen-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsividade - Mobile First */
@media (max-width: 767px) {
    .rgen-container {
        padding: 15px 10px;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .rgen-title {
        font-size: 1.5em;
    }
    
    .rgen-description-container {
        margin-top: 10px;
        margin-bottom: 0;
    }
    
    .rgen-description-content {
        padding: 12px 15px;
    }
    
    .rgen-description-content .rgen-description,
    .rgen-description {
        font-size: 0.9em;
        line-height: 1.5;
    }
    
    /* Caixa de nome e botões */
    .rgen-name-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .rgen-current-name {
        margin-bottom: 0;
        padding: 15px;
        font-size: 1.2em;
        min-height: 50px;
    }
    
    .rgen-controls-side {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 12px;
    }
    
    /* Botões maiores para touch */
    .rgen-btn-icon {
        width: 70px;
        height: 70px;
        min-width: 70px;
        min-height: 70px;
    }
    
    .rgen-btn-icon .rgen-icon {
        width: 36px;
        height: 36px;
    }
    
    .rgen-generate-small {
        width: 50px;
        height: 50px;
    }
    
    .rgen-generate-small .rgen-icon {
        width: 28px;
        height: 28px;
    }
    
    /* Configurações */
    .rgen-settings {
        gap: 20px;
    }
    
    .rgen-setting-group {
        padding: 15px;
    }
    
    .rgen-label {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .rgen-description {
        font-size: 0.85em;
        line-height: 1.4;
        margin-bottom: 12px !important;
    }
    
    /* Slider */
    .rgen-slider-wrapper {
        gap: 12px;
    }
    
    .rgen-slider-value {
        font-size: 1.1em;
        min-width: 35px;
    }
    
    /* Colunas - empilhar em mobile */
    .rgen-settings-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .rgen-settings-column {
        gap: 20px;
    }
    
    /* Gênero */
    .rgen-gender-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .rgen-gender-options {
        justify-content: center;
        width: 100%;
        gap: 12px;
    }
    
    .rgen-gender-option {
        width: 45px;
        height: 45px;
        padding: 10px;
    }
    
    .rgen-gender-icon {
        width: 22px;
        height: 22px;
    }
    
    /* Incluir */
    .rgen-include-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .rgen-input-inline {
        max-width: 100%;
        min-width: 100%;
        width: 100%;
    }
    
    /* Configurações Adicionais */
    .rgen-additional-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .rgen-checkboxes-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        width: 100%;
    }
    
    /* Estilos */
    .rgen-styles {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .rgen-checkbox-label {
        font-size: 0.9em;
    }
    
    /* Personalizar */
    .rgen-personalize {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rgen-input-small {
        padding: 12px;
        font-size: 1em;
    }
    
    /* Tooltips - ajustar para mobile */
    .rgen-help-tooltip {
        width: calc(100% - 20px);
        max-width: 300px;
        left: 0;
        transform: translateX(0);
        font-size: 0.85em;
        padding: 12px;
    }
    
    .rgen-help-tooltip::after {
        left: 20px;
        transform: translateX(0);
    }
    
    /* Resultados */
    .rgen-result-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    
    .rgen-result-name {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .rgen-result-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .rgen-btn-small {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    /* Toast */
    .rgen-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 0.9em;
    }
}

/* Tablets - ajustes intermediários */
@media (min-width: 768px) and (max-width: 1024px) {
    .rgen-container {
        padding: 20px 25px;
    }
    
    .rgen-name-wrapper {
        gap: 15px;
    }
    
    .rgen-btn-icon {
        width: 80px;
        height: 80px;
    }
    
    .rgen-btn-icon .rgen-icon {
        width: 40px;
        height: 40px;
    }
    
    .rgen-settings-columns {
        gap: 25px;
    }
    
    .rgen-styles {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rgen-personalize {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Melhorias de touch para todos os dispositivos móveis */
@media (hover: none) and (pointer: coarse) {
    .rgen-btn,
    .rgen-btn-icon {
        min-height: 44px;
        min-width: 44px;
    }
    
    .rgen-checkbox {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
    }
    
    .rgen-input,
    .rgen-input-inline,
    .rgen-input-small {
        min-height: 44px;
        padding: 12px;
    }
    
    .rgen-gender-option {
        min-width: 44px;
        min-height: 44px;
    }
    
    .rgen-slider {
        height: 8px;
    }
    
    .rgen-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .rgen-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
}

/* Acessibilidade */
.rgen-btn:focus,
.rgen-input:focus,
.rgen-checkbox:focus,
.rgen-slider:focus {
    outline: 2px solid #00a859;
    outline-offset: 2px;
}

.rgen-gender-option:focus-within {
    outline: 2px solid #00a859;
    outline-offset: 2px;
}

/* Melhorias adicionais para mobile */
@media (max-width: 767px) {
    /* Prevenir zoom em inputs no iOS */
    input[type="text"],
    input[type="range"] {
        font-size: 16px;
    }
    
    /* Melhorar scroll horizontal se necessário */
    .rgen-container {
        overflow-x: hidden;
    }
    
    /* Ajustar espaçamento do header */
    .rgen-header {
        margin-bottom: 20px;
    }
    
    /* Melhorar legibilidade do texto */
    body .rgen-container {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Ajustar tooltips para não sair da tela */
    .rgen-help-icon {
        position: relative;
    }
    
    /* Garantir que botões não fiquem muito pequenos */
    .rgen-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    /* Melhorar área de toque para checkboxes */
    .rgen-checkbox-label {
        padding: 8px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Ajustes para telas muito pequenas (menos de 360px) */
@media (max-width: 360px) {
    .rgen-container {
        padding: 12px 8px;
    }
    
    .rgen-btn-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }
    
    .rgen-btn-icon .rgen-icon {
        width: 32px;
        height: 32px;
    }
    
    .rgen-current-name {
        font-size: 1.1em;
        padding: 12px;
    }
    
    .rgen-styles {
        grid-template-columns: 1fr;
    }
    
    .rgen-gender-option {
        width: 40px;
        height: 40px;
    }
    
    .rgen-gender-icon {
        width: 20px;
        height: 20px;
    }
}

/* Orientação landscape em mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .rgen-name-wrapper {
        flex-direction: row;
        align-items: center;
    }
    
    .rgen-controls-side {
        flex-shrink: 0;
    }
    
    .rgen-current-name {
        margin-bottom: 0;
    }
    
    .rgen-settings-columns {
        grid-template-columns: 1fr 1fr;
    }
    
    .rgen-styles {
        grid-template-columns: repeat(3, 1fr);
    }
}

