/* styles.css */

/* Reset básico y tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    background-color: #007bff;
    color: white;
}

h1, h2 {
    margin-bottom: 1rem;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#length {
    width: 100%;
}

#length-value {
    text-align: center;
    font-weight: bold;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

.result {
    display: flex;
    margin-top: 1rem;
}

#password {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-family: monospace;
    font-size: 1.1rem;
}

#copy-btn {
    border-radius: 0 4px 4px 0;
}

.strength {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#strength-bar {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background-color: #e0e0e0;
    position: relative;
}

#strength-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.error {
    color: red;
    margin-top: 1rem;
}

.explanation {
    margin-bottom: 2rem;
}

.explanation p {
    margin-bottom: 1rem;
}

.ads-placeholder {
    background-color: #f0f0f0;
    text-align: center;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-style: italic;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #007bff;
    color: white;
}

footer a {
    color: white;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ccc;
}

/* Responsive design - Mobile-first */
@media (min-width: 768px) {
    .generator-form {
        max-width: 600px;
        margin: 0 auto;
    }

    .options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .options label {
        flex-basis: 48%;
    }
}

/* Animaciones suaves */
button:active {
    transform: scale(0.98);
}

#password {
    transition: border-color 0.3s ease;
}

#password:focus {
    border-color: #007bff;
}

/* Colores para indicador de fuerza */
.weak #strength-bar::before {
    width: 33%;
    background-color: red;
}

.medium #strength-bar::before {
    width: 66%;
    background-color: orange;
}

.strong #strength-bar::before {
    width: 100%;
    background-color: green;
}


/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 300px;
    background-color: #28a745;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s ease-in-out;
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Variante de error (opcional, por si quieres usarlo después) */
.toast.error {
    background-color: #dc3545;
}

/* Responsive - en móviles más centrado */
@media (max-width: 600px) {
    .toast {
        bottom: 20px;
        right: 15px;
        left: 15px;
        min-width: auto;
        max-width: calc(100% - 30px);
    }
}