/* css/style.css */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --text-color: #333;
    --border-color: #dfe3e8;
    --success-color: #28a745;
    --error-color: #dc3545;
    --white: #fff;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

/* --- Contenedor de Login --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container form {
    padding: 40px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.error-message {
    background-color: var(--error-color);
    color: var(--white);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Estilos para el ícono de mostrar contraseña */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px !important; 
}

.password-wrapper i {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.password-wrapper i:hover {
    color: var(--primary-color);
}


/* --- Estilos Generales y Header --- */
.main-header {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.main-header nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-user {
    font-size: 0.9rem;
}

/* --- Botones y Enlaces --- */
.btn-link, .btn-logout, button {
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-link {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.btn-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-link.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-logout {
    background: transparent;
    color: var(--error-color);
}
.btn-logout:hover {
    background: var(--error-color);
    color: var(--white);
}

.btn-save, .login-container button {
    background-color: var(--success-color);
    color: var(--white);
    font-size: 1rem;
}
.btn-save:hover, .login-container button:hover {
    opacity: 0.9;
}

/* --- Contenedor principal y Tarjetas --- */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.card h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.card h2 .fa-solid {
    margin-right: 10px;
}

/* --- Formularios --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.form-actions {
    text-align: right;
}

/* --- Estilos Planificador de Disponibilidad --- */
.radio-group { display: flex; align-items: center; margin-bottom: 0.5rem; }
.radio-group input[type="radio"] { margin-right: 10px; }

#scheduler-container {
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}
.day-schedule {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f2f5;
}
.day-schedule:last-child { border-bottom: none; }

.day-header { display: flex; align-items: center; width: 150px; flex-shrink: 0; }
.day-name { font-weight: 600; margin-left: 15px; }

.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(22px); }

.time-blocks-wrapper { flex-grow: 1; }
.time-block { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 0.5rem; }
.time-block .time-input {
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin: 0 5px;
}
.time-block span { color: #999; }
.remove-block-btn, .add-block-btn {
    background: none; border: none; cursor: pointer; color: #999; margin-left: 10px;
}
.remove-block-btn:hover { color: var(--error-color); }
.add-block-btn {
    border: 1px dashed var(--border-color);
    border-radius: 5px;
    padding: 5px 10px;
    margin-top: 5px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}
.add-block-btn:hover { color: var(--primary-color); border-color: var(--primary-color); }

.d-none { display: none !important; }

.d-flex { display: flex; }
.justify-content-end { justify-content: flex-end; }
.mb-3 { margin-bottom: 1rem; }

/* --- Responsividad --- */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .main-header nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .btn-link, .btn-logout {
        text-align: center;
        width: 100%;
    }
    
    .container {
        padding: 0 0.5rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .day-schedule {
        flex-direction: column;
        align-items: stretch;
    }

    .day-header {
        margin-bottom: 1rem;
    }
}