/* ============================================
   GERADOR DE SENHAS SEGURAS
   Tema: Roxo/Violeta Produtividade (#8e44ad)
   Design: Glassmorphism + Vapor Theme
   ============================================ */

:root {
    --color-primary: #8e44ad;
    --color-primary-dark: #71368a;
    --color-primary-light: #a569bd;
    --color-secondary: #3498db;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    
    --glass-bg: rgba(142, 68, 173, 0.05);
    --glass-border: rgba(142, 68, 173, 0.15);
    --glass-shadow: 0 8px 32px rgba(142, 68, 173, 0.15);
    
    --gradient-primary: linear-gradient(135deg, rgba(142, 68, 173, 0.9) 0%, rgba(113, 54, 138, 0.8) 100%);
    --gradient-card: linear-gradient(135deg, rgba(142, 68, 173, 0.08) 0%, rgba(52, 152, 219, 0.06) 100%);
    
    /* Strength Colors */
    --strength-very-weak: #e74c3c;
    --strength-weak: #e67e22;
    --strength-medium: #f39c12;
    --strength-strong: #27ae60;
    --strength-very-strong: #16a085;
}

/* ============================================
   ÍCONE DO GERADOR
   ============================================ */
.calculator-icon {
    font-size: 5rem;
    color: var(--color-primary);
    text-shadow: 0 0 30px rgba(142, 68, 173, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

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

/* ============================================
   GLASS EFFECT CARDS
   ============================================ */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden; /* Previne overflow de conteúdo */
}

.glass-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(142, 68, 173, 0.25);
    border-color: rgba(142, 68, 173, 0.3);
}

.glass-effect .card-body {
    overflow-x: hidden; /* Previne overflow horizontal */
    max-width: 100%;
}

/* ============================================
   DISPLAY DA SENHA
   ============================================ */
.password-display-container {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.password-display {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(142, 68, 173, 0.3);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
    min-height: 70px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.password-display.has-password {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(142, 68, 173, 0.3);
}

.btn-copy {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    align-self: stretch;
    min-width: 120px;
}

.btn-copy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
}

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

.btn-copy.copied {
    background: linear-gradient(135deg, #27ae60 0%, #16a085 100%);
}

/* ============================================
   MEDIDOR DE FORÇA
   ============================================ */
.strength-meter {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.strength-meter-bar {
    height: 100%;
    width: 0%;
    transition: all 0.5s ease;
    border-radius: 4px;
}

.strength-meter-bar.very-weak {
    width: 20%;
    background: var(--strength-very-weak);
}

.strength-meter-bar.weak {
    width: 40%;
    background: var(--strength-weak);
}

.strength-meter-bar.medium {
    width: 60%;
    background: var(--strength-medium);
}

.strength-meter-bar.strong {
    width: 80%;
    background: var(--strength-strong);
}

.strength-meter-bar.very-strong {
    width: 100%;
    background: var(--strength-very-strong);
    box-shadow: 0 0 10px var(--strength-very-strong);
}

.strength-label {
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.strength-label.very-weak {
    color: var(--strength-very-weak);
}

.strength-label.weak {
    color: var(--strength-weak);
}

.strength-label.medium {
    color: var(--strength-medium);
}

.strength-label.strong {
    color: var(--strength-strong);
}

.strength-label.very-strong {
    color: var(--strength-very-strong);
}

/* ============================================
   FORMULÁRIO
   ============================================ */
.form-range {
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.4);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.4);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
}

.btn-outline-primary {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ============================================
   HISTÓRICO
   ============================================ */

/* Reset para prevenir interferências de CSS global */
.history-list * {
    box-sizing: border-box;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.history-item {
    background: rgba(142, 68, 173, 0.1);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-width: 0; /* Fix para flex overflow */
    width: 100%;
}

.history-item:hover {
    background: rgba(142, 68, 173, 0.15);
    transform: translateX(4px);
}

.history-password {
    font-family: 'Courier New', monospace !important;
    font-size: 0.875rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    flex: 1;
    min-width: 0 !important; /* Fix para flex overflow */
    max-width: 100% !important;
    white-space: pre-wrap !important; /* Preserva espaços mas quebra quando necessário */
    line-height: 1.4 !important;
    display: block !important; /* Força display block */
    text-align: left !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.history-copy-btn {
    background: transparent;
    border: none;
    color: var(--color-primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-copy-btn:hover {
    background: rgba(142, 68, 173, 0.2);
    color: #fff;
}

/* Scrollbar do histórico */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(142, 68, 173, 0.1);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(142, 68, 173, 0.4);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 68, 173, 0.6);
}

/* ============================================
   DICAS DE SEGURANÇA
   ============================================ */
.security-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-tips li {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(142, 68, 173, 0.1);
}

.security-tips li:last-child {
    border-bottom: none;
}

/* ============================================
   SENHAS EM LOTE
   ============================================ */
.batch-passwords-list {
    max-height: 400px;
    overflow-y: auto;
}

.batch-password-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.batch-password-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--color-primary);
}

.batch-password-text {
    flex: 1;
    word-break: break-all;
}

.batch-password-copy {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.batch-password-copy:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ============================================
   EXEMPLOS DE FORÇA
   ============================================ */
.strength-bar-mini {
    width: 50px;
    height: 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.strength-bar-mini.very-weak {
    background: var(--strength-very-weak);
}

.strength-bar-mini.weak {
    background: var(--strength-weak);
}

.strength-bar-mini.medium {
    background: var(--strength-medium);
}

.strength-bar-mini.strong {
    background: var(--strength-strong);
}

.strength-bar-mini.very-strong {
    background: var(--strength-very-strong);
}

.strength-example {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(142, 68, 173, 0.1);
}

.strength-example:last-child {
    border-bottom: none;
}

/* ============================================
   FAQ
   ============================================ */
.faq-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(142, 68, 173, 0.1);
}

.faq-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    background: rgba(142, 68, 173, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-header {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toast .btn-close {
    filter: invert(1);
}

/* ============================================
   ANIMAÇÕES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Prevenção de overflow na sidebar */
.col-lg-4 {
    overflow-x: hidden;
    max-width: 100%;
}

.row {
    overflow-x: hidden;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .calculator-icon {
        font-size: 4rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .password-display {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .password-display-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-copy {
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .batch-password-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .batch-password-copy {
        width: 100%;
        text-align: center;
    }
    
    .password-display {
        font-size: 0.95rem;
    }
}

/* ============================================
   BACKGROUND SHAPES (DECORATIVO)
   ============================================ */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--color-secondary);
    bottom: 20%;
    right: 15%;
    animation-delay: 5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--color-primary-dark);
    top: 60%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}
