/* --- Estilos Generales --- */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

a {
    color: #007bff;
    text-decoration: none;
}

/* --- Formularios (Login, Register, Add, Edit) --- */
.form-container {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.form-container h2 {
    text-align: center;
    margin-top: 0;
}

.form-container div {
    margin-bottom: 15px;
}

.form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-container input[type="text"],
.form-container input[type="password"],
textarea { /* Aplicar también a textarea */
    width: 100%;
    padding: 8px;
    box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif; /* Heredar fuente */
    font-size: 14px; /* Heredar tamaño */
}

textarea {
    min-height: 120px; /* Altura mínima para notas */
}

.form-container button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.form-container button:hover {
    background-color: #0056b3;
}

.form-container p {
    text-align: center;
    font-size: 0.9em;
}

.error {
    color: #D8000C;
    background-color: #FFD2D2;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.success {
    color: #4F8A10;
    background-color: #DFF2BF;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

/* --- Barra de Navegación (Menú Hamburguesa) --- */
.navbar {
    background-color: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 1.5em;
    font-weight: bold;
}

.nav-links {
    display: none; /* Oculto por defecto en móviles */
    width: 100%; /* Ocupa todo el ancho en móvil */
    flex-direction: column;
    align-items: center;
}

.nav-links a {
    color: white;
    padding: 10px 0;
    display: block;
    width: 100%;
    text-align: center;
}

.nav-links a:hover {
    background-color: #555;
}

.hamburger {
    display: block; /* Visible por defecto en móviles */
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* --- Estado Activo para el Menú --- */
.nav-links.active {
    display: flex;
}

/* --- Estilos de Escritorio (Desktop) --- */
@media (min-width: 768px) {
    .hamburger {
        display: none; /* Ocultar hamburguesa en escritorio */
    }

    .nav-links {
        display: flex; /* Mostrar links en escritorio */
        flex-direction: row;
        width: auto; /* Ancho automático en escritorio */
    }

    .nav-links a {
        padding: 10px 15px;
        width: auto;
    }
}


/* --- Estilos para el Buscador --- */
.search-container {
    margin-bottom: 20px;
}

.search-container input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Para que el padding no afecte el ancho */
}


/* --- Tabla de Contraseñas (Dashboard) --- */
.password-list table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.password-list th,
.password-list td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.password-list th {
    background-color: #f4f4f4;
}

/* Estilo para los campos de contenido y notas */
.password-list .password-field {
    white-space: normal;
    word-break: break-all;
}

/* --- Estilos para Botones de Acción (Edit/Delete) --- */
.btn-edit {
    color: white;
    background-color: #007bff; /* Azul */
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    display: inline-block; /* Para que el margen funcione */
    margin-bottom: 5px; /* Espacio en móviles */
}

.btn-edit:hover {
    background-color: #0056b3;
}

.btn-delete {
    color: white;
    background-color: #dc3545; /* Rojo */
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    display: inline-block;
    margin-bottom: 5px;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* En escritorio, ponerlos en la misma línea */
@media (min-width: 768px) {
    .btn-edit {
        margin-right: 5px;
        margin-bottom: 0;
    }
    .btn-delete {
         margin-bottom: 0;
    }
}


/* --- Responsividad de la Tabla --- */
@media (max-width: 767px) {
    .password-list table thead {
        display: none; /* Ocultar encabezados de tabla */
    }

    .password-list table,
    .password-list table tbody,
    .password-list table tr,
    .password-list table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .password-list table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .password-list table td {
        text-align: right; /* Alinear texto a la derecha */
        padding-left: 50%; /* Espacio para la etiqueta */
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .password-list table td::before {
        content: attr(data-label); /* Usar el data-label como etiqueta */
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
    }

    .password-list table td:last-child {
        border-bottom: 0;
    }
}